[40/41] Do not use f_mapping in simple_prepare_write()

From: Christoph Lameter
Date: Tue Sep 11 2007 - 02:18:41 EST


Seems that simple_prepare_write() may occasionally be called for a page
that does not have a mapping yet. Retrieve the page size from the page
instead of the mapping.

Signed-off-by: Christoph Lameter <clameter@xxxxxxx>
---
fs/libfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/fs/libfs.c
===================================================================
--- linux-2.6.orig/fs/libfs.c 2007-09-05 01:22:02.000000000 -0700
+++ linux-2.6/fs/libfs.c 2007-09-05 01:52:34.000000000 -0700
@@ -341,10 +341,10 @@ int simple_prepare_write(struct file *fi
unsigned from, unsigned to)
{
if (!PageUptodate(page)) {
- if (to - from != page_cache_size(file->f_mapping))
+ if (to - from != page_cache_page_size(page))
zero_user_segments(page,
0, from,
- to, page_cache_size(file->f_mapping));
+ to, page_cache_page_size(page));
}
return 0;
}

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/