lkml.org 
[lkml]   [2007]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[40/41] Do not use f_mapping in simple_prepare_write()
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@sgi.com>
---
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-09-11 08:21    [W:0.283 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site