From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ernst.netinsight.se ([194.16.221.21]) by bombadil.infradead.org with smtp (Exim 4.69 #1 (Red Hat Linux)) id 1MXyzR-00084d-A3 for linux-mtd@lists.infradead.org; Mon, 03 Aug 2009 14:58:22 +0000 Message-ID: <4A76FAFE.6050906@users.sourceforge.net> Date: Mon, 03 Aug 2009 16:58:06 +0200 From: =?ISO-8859-1?Q?Anders_Grafstr=F6m?= MIME-Version: 1.0 To: David Woodhouse , Linux-MTD Mailing List Subject: [PATCH] [JFFS2] Fix return value from jffs2_do_readpage_nolock() Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , [JFFS2] Fix return value from jffs2_do_readpage_nolock() 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 --- This issue has resurfaced on linux-mtd a couple of times now. So here's the patch for it once more. This time with a proper commit message. fs/jffs2/file.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index 5edc2bf..23c9475 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c @@ -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)