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

jffs_prepare_write() fails to ensure page is uptodate.



Can people sanity-check and test this before I commit it to the 2.4 branch 
and send it to Alan/Linus?


Index: inode-v23.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs/inode-v23.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- inode-v23.c	2001/01/11 00:10:21	1.58
+++ inode-v23.c	2001/02/09 23:21:39	1.59
@@ -10,7 +10,7 @@
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  *
- * $Id: inode-v23.c,v 1.58 2001/01/11 00:10:21 dwmw2 Exp $
+ * $Id: inode-v23.c,v 1.59 2001/02/09 23:21:39 dwmw2 Exp $
  *
  *
  * Ported to Linux 2.3.x and MTD:
@@ -1481,9 +1481,13 @@
 jffs_prepare_write(struct file *filp, struct page *page,
                   unsigned from, unsigned to)
 {
-       /* FIXME: we should detect some error conditions here */
+	/* FIXME: we should detect some error conditions here */
+	
+	/* Bugger that. We should make sure the page is uptodate */
+	if (!Page_Uptodate(page) && (from || to < PAGE_CACHE_SIZE))
+		return jffs_readpage(filp, page);
 
-       return 0;
+	return 0;
 } /* jffs_prepare_write() */
 
 static ssize_t

--
dwmw2



To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com