Skip to contentSkip to conversation

Fix return value from jffs2_do_readpage_nolock()

PATCH In review Anders Grafström 1 participant 2 messages Aug 3, 2009 – Aug 4, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix return value from jffs2_do_readpage_nolock()

[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));
}

---

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(-)
fs/jffs2/file.c +1 -1
index 5edc2bf..23c9475 100644
@@ -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)
#1 lore raw

[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));
}

---

Looks like the previous post got mangled so here's another try.

 fs/jffs2/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/jffs2/file.c +1 -1
index 5edc2bf..23c9475 100644
@@ -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)