diff options
Diffstat (limited to 'fs/ecryptfs/mmap.c')
-rw-r--r-- | fs/ecryptfs/mmap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c index 9bc707df3b60..6ae0afb238d1 100644 --- a/fs/ecryptfs/mmap.c +++ b/fs/ecryptfs/mmap.c | |||
@@ -286,7 +286,8 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page, | |||
286 | int rc = 0; | 286 | int rc = 0; |
287 | 287 | ||
288 | while (extent_num_in_page < num_extents_per_page) { | 288 | while (extent_num_in_page < num_extents_per_page) { |
289 | loff_t view_extent_num = ((page->index * num_extents_per_page) | 289 | loff_t view_extent_num = ((((loff_t)page->index) |
290 | * num_extents_per_page) | ||
290 | + extent_num_in_page); | 291 | + extent_num_in_page); |
291 | 292 | ||
292 | if (view_extent_num < crypt_stat->num_header_extents_at_front) { | 293 | if (view_extent_num < crypt_stat->num_header_extents_at_front) { |
@@ -706,7 +707,7 @@ static int ecryptfs_commit_write(struct file *file, struct page *page, | |||
706 | "index [0x%.16x])\n", page->index); | 707 | "index [0x%.16x])\n", page->index); |
707 | goto out; | 708 | goto out; |
708 | } | 709 | } |
709 | pos = (page->index << PAGE_CACHE_SHIFT) + to; | 710 | pos = (((loff_t)page->index) << PAGE_CACHE_SHIFT) + to; |
710 | if (pos > i_size_read(ecryptfs_inode)) { | 711 | if (pos > i_size_read(ecryptfs_inode)) { |
711 | i_size_write(ecryptfs_inode, pos); | 712 | i_size_write(ecryptfs_inode, pos); |
712 | ecryptfs_printk(KERN_DEBUG, "Expanded file size to " | 713 | ecryptfs_printk(KERN_DEBUG, "Expanded file size to " |