Skip to content

Commit

Permalink
jffs2: Fix return value from jffs2_do_readpage_nolock()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Anders Grafström authored and David Woodhouse committed Aug 4, 2009
1 parent d676c11 commit 57ca7de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/jffs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 57ca7de

Please sign in to comment.