From 1833633803c7ef4d8f09877d3f1549cbd252f477 Mon Sep 17 00:00:00 2001 From: Nick Piggin Date: Fri, 20 Jul 2007 00:31:45 -0700 Subject: 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 Cc: Michael Halcrow Cc: Mark Fasheh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/buffer.c') 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, lock_page(page); size = i_size_read(inode); if ((page->mapping != inode->i_mapping) || - ((page->index << PAGE_CACHE_SHIFT) > size)) { + (page_offset(page) > size)) { /* page got truncated out from underneath us */ goto out_unlock; } -- cgit v1.2.3