diff options
author | Nick Piggin <npiggin@suse.de> | 2007-07-20 03:31:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-20 11:44:19 -0400 |
commit | 1833633803c7ef4d8f09877d3f1549cbd252f477 (patch) | |
tree | ce69505de705701f838bd77c6b6b6bc18529bed0 /fs/buffer.c | |
parent | e228929bc257b963523ed75aa60d2ad77ece2189 (diff) |
fix some conversion overflows
Fix page index to offset conversion overflows in buffer layer, ecryptfs,
and ocfs2.
It would be nice to convert the whole tree to page_offset, but for now
just fix the bugs.
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 02ebb1f1d3b0..0e5ec371ce72 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -2221,7 +2221,7 @@ block_page_mkwrite(struct vm_area_struct *vma, struct page *page, | |||
2221 | lock_page(page); | 2221 | lock_page(page); |
2222 | size = i_size_read(inode); | 2222 | size = i_size_read(inode); |
2223 | if ((page->mapping != inode->i_mapping) || | 2223 | if ((page->mapping != inode->i_mapping) || |
2224 | ((page->index << PAGE_CACHE_SHIFT) > size)) { | 2224 | (page_offset(page) > size)) { |
2225 | /* page got truncated out from underneath us */ | 2225 | /* page got truncated out from underneath us */ |
2226 | goto out_unlock; | 2226 | goto out_unlock; |
2227 | } | 2227 | } |