diff options
author | Joe Perches <joe@perches.com> | 2010-11-10 18:46:16 -0500 |
---|---|---|
committer | Tyler Hicks <tyhicks@linux.vnet.ibm.com> | 2011-01-17 14:01:23 -0500 |
commit | 888d57bbc91ebd031451d4ab1c669baee826a06c (patch) | |
tree | a446e3d6f7134a50d5118702fadba04ab5ee3c14 /fs/ecryptfs/mmap.c | |
parent | 0abe1169470571c473ee720c35fe5b3481c46c46 (diff) |
fs/ecryptfs: Add printf format/argument verification and fix fallout
Add __attribute__((format... to __ecryptfs_printk
Make formats and arguments match.
Add casts to (unsigned long long) for %llu.
Signed-off-by: Joe Perches <joe@perches.com>
[tyhicks: 80 columns cleanup and fixed typo]
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Diffstat (limited to 'fs/ecryptfs/mmap.c')
-rw-r--r-- | fs/ecryptfs/mmap.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c index b1d82756544b..4b9011392736 100644 --- a/fs/ecryptfs/mmap.c +++ b/fs/ecryptfs/mmap.c | |||
@@ -65,7 +65,7 @@ static int ecryptfs_writepage(struct page *page, struct writeback_control *wbc) | |||
65 | rc = ecryptfs_encrypt_page(page); | 65 | rc = ecryptfs_encrypt_page(page); |
66 | if (rc) { | 66 | if (rc) { |
67 | ecryptfs_printk(KERN_WARNING, "Error encrypting " | 67 | ecryptfs_printk(KERN_WARNING, "Error encrypting " |
68 | "page (upper index [0x%.16x])\n", page->index); | 68 | "page (upper index [0x%.16lx])\n", page->index); |
69 | ClearPageUptodate(page); | 69 | ClearPageUptodate(page); |
70 | goto out; | 70 | goto out; |
71 | } | 71 | } |
@@ -237,7 +237,7 @@ out: | |||
237 | ClearPageUptodate(page); | 237 | ClearPageUptodate(page); |
238 | else | 238 | else |
239 | SetPageUptodate(page); | 239 | SetPageUptodate(page); |
240 | ecryptfs_printk(KERN_DEBUG, "Unlocking page with index = [0x%.16x]\n", | 240 | ecryptfs_printk(KERN_DEBUG, "Unlocking page with index = [0x%.16lx]\n", |
241 | page->index); | 241 | page->index); |
242 | unlock_page(page); | 242 | unlock_page(page); |
243 | return rc; | 243 | return rc; |
@@ -488,7 +488,7 @@ static int ecryptfs_write_end(struct file *file, | |||
488 | } else | 488 | } else |
489 | ecryptfs_printk(KERN_DEBUG, "Not a new file\n"); | 489 | ecryptfs_printk(KERN_DEBUG, "Not a new file\n"); |
490 | ecryptfs_printk(KERN_DEBUG, "Calling fill_zeros_to_end_of_page" | 490 | ecryptfs_printk(KERN_DEBUG, "Calling fill_zeros_to_end_of_page" |
491 | "(page w/ index = [0x%.16x], to = [%d])\n", index, to); | 491 | "(page w/ index = [0x%.16lx], to = [%d])\n", index, to); |
492 | if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) { | 492 | if (!(crypt_stat->flags & ECRYPTFS_ENCRYPTED)) { |
493 | rc = ecryptfs_write_lower_page_segment(ecryptfs_inode, page, 0, | 493 | rc = ecryptfs_write_lower_page_segment(ecryptfs_inode, page, 0, |
494 | to); | 494 | to); |
@@ -503,19 +503,20 @@ static int ecryptfs_write_end(struct file *file, | |||
503 | rc = fill_zeros_to_end_of_page(page, to); | 503 | rc = fill_zeros_to_end_of_page(page, to); |
504 | if (rc) { | 504 | if (rc) { |
505 | ecryptfs_printk(KERN_WARNING, "Error attempting to fill " | 505 | ecryptfs_printk(KERN_WARNING, "Error attempting to fill " |
506 | "zeros in page with index = [0x%.16x]\n", index); | 506 | "zeros in page with index = [0x%.16lx]\n", index); |
507 | goto out; | 507 | goto out; |
508 | } | 508 | } |
509 | rc = ecryptfs_encrypt_page(page); | 509 | rc = ecryptfs_encrypt_page(page); |
510 | if (rc) { | 510 | if (rc) { |
511 | ecryptfs_printk(KERN_WARNING, "Error encrypting page (upper " | 511 | ecryptfs_printk(KERN_WARNING, "Error encrypting page (upper " |
512 | "index [0x%.16x])\n", index); | 512 | "index [0x%.16lx])\n", index); |
513 | goto out; | 513 | goto out; |
514 | } | 514 | } |
515 | if (pos + copied > i_size_read(ecryptfs_inode)) { | 515 | if (pos + copied > i_size_read(ecryptfs_inode)) { |
516 | i_size_write(ecryptfs_inode, pos + copied); | 516 | i_size_write(ecryptfs_inode, pos + copied); |
517 | ecryptfs_printk(KERN_DEBUG, "Expanded file size to " | 517 | ecryptfs_printk(KERN_DEBUG, "Expanded file size to " |
518 | "[0x%.16x]\n", i_size_read(ecryptfs_inode)); | 518 | "[0x%.16llx]\n", |
519 | (unsigned long long)i_size_read(ecryptfs_inode)); | ||
519 | } | 520 | } |
520 | rc = ecryptfs_write_inode_size_to_metadata(ecryptfs_inode); | 521 | rc = ecryptfs_write_inode_size_to_metadata(ecryptfs_inode); |
521 | if (rc) | 522 | if (rc) |