summaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/read_write.c
diff options
context:
space:
mode:
authorMichael Halcrow <mhalcrow@us.ibm.com>2007-10-16 10:28:12 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 18:43:12 +0200
commitd6a13c17164fccab8aa96ca435ddacbf428335ca (patch)
tree8995bb0b5c22a97c8f6c86eff797ff2de0421ee2 /fs/ecryptfs/read_write.c
parenteCryptfs: convert mmap functions to use persistent file (diff)
downloadlinux-d6a13c17164fccab8aa96ca435ddacbf428335ca.tar.xz
linux-d6a13c17164fccab8aa96ca435ddacbf428335ca.zip
eCryptfs: fix data types
Update data types and add casts in order to avoid potential overflow issues. Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs/read_write.c')
-rw-r--r--fs/ecryptfs/read_write.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c
index ccd2599e0a4f..272eaeb9a738 100644
--- a/fs/ecryptfs/read_write.c
+++ b/fs/ecryptfs/read_write.c
@@ -87,7 +87,8 @@ int ecryptfs_write_lower_page_segment(struct inode *ecryptfs_inode,
loff_t offset;
int rc;
- offset = (page_for_lower->index << PAGE_CACHE_SHIFT) + offset_in_page;
+ offset = ((((off_t)page_for_lower->index) << PAGE_CACHE_SHIFT)
+ + offset_in_page);
virt = kmap(page_for_lower);
rc = ecryptfs_write_lower(ecryptfs_inode, virt, offset, size);
kunmap(page_for_lower);
@@ -117,7 +118,8 @@ int ecryptfs_write(struct file *ecryptfs_file, char *data, loff_t offset,
{
struct page *ecryptfs_page;
char *ecryptfs_page_virt;
- u64 ecryptfs_file_size = i_size_read(ecryptfs_file->f_dentry->d_inode);
+ loff_t ecryptfs_file_size =
+ i_size_read(ecryptfs_file->f_dentry->d_inode);
loff_t data_offset = 0;
loff_t pos;
int rc = 0;
@@ -277,7 +279,7 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs,
loff_t offset;
int rc;
- offset = ((page_index << PAGE_CACHE_SHIFT) + offset_in_page);
+ offset = ((((loff_t)page_index) << PAGE_CACHE_SHIFT) + offset_in_page);
virt = kmap(page_for_ecryptfs);
rc = ecryptfs_read_lower(virt, offset, size, ecryptfs_inode);
kunmap(page_for_ecryptfs);
@@ -306,7 +308,8 @@ int ecryptfs_read(char *data, loff_t offset, size_t size,
{
struct page *ecryptfs_page;
char *ecryptfs_page_virt;
- u64 ecryptfs_file_size = i_size_read(ecryptfs_file->f_dentry->d_inode);
+ loff_t ecryptfs_file_size =
+ i_size_read(ecryptfs_file->f_dentry->d_inode);
loff_t data_offset = 0;
loff_t pos;
int rc = 0;