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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>
---
 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux