jffs2: Fix return value from jffs2_do_readpage_nolock()
authorAnders Grafström <grfstrm@users.sourceforge.net>
Tue, 4 Aug 2009 11:11:47 +0000 (13:11 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 4 Aug 2009 11:13:06 +0000 (12:13 +0100)
This fixes "kernel BUG at fs/jffs2/file.c:251!".
This pseudocode hopefully illustrates the scenario that triggers it:

jffs2_write_begin {
     jffs2_do_readpage_nolock {
         jffs2_read_inode_range {
             jffs2_read_dnode {
                 Data CRC 33c102e9 != calculated CRC 0ef77e7b for node at 005d42e4
                 return -EIO;
             }
         }
         ClearPageUptodate(pg);
         return 0;
     }
}

jffs2_write_end {
     BUG_ON(!PageUptodate(pg));
}

Signed-off-by: Anders Grafström <grfstrm@users.sourceforge.net>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
fs/jffs2/file.c

index 5edc2bf2058134505369a0f7844363f7e3a2ecfd..23c947539864a0c0613ade018cb9e6400149de3a 100644 (file)
@@ -99,7 +99,7 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
        kunmap(pg);
 
        D2(printk(KERN_DEBUG "readpage finished\n"));
-       return 0;
+       return ret;
 }
 
 int jffs2_do_readpage_unlock(struct inode *inode, struct page *pg)