From: Lothar Waßmann Date: Sat, 25 May 2013 14:38:52 +0000 (+0200) Subject: let JFFS2 work without OOB X-Git-Tag: KARO-TX6-2013-06-13~2 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-linux.git;a=commitdiff_plain;h=f660ec21ba209fc092fe9699b2222f20987ca715 let JFFS2 work without OOB --- diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index c2dc1f0de79c..aedabe0d8532 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -1784,6 +1784,9 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from, else len = mtd->oobsize; + if (len == 0) + return 0; + if (unlikely(ops->ooboffs >= len)) { DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt to start read " "outside oob\n", __func__); @@ -2383,6 +2386,9 @@ static int nand_do_write_oob(struct mtd_info *mtd, loff_t to, else len = mtd->oobsize; + if (len == 0) + return 0; + /* Do not allow write past end of page */ if ((ops->ooboffs + ops->ooblen) > len) { DEBUG(MTD_DEBUG_LEVEL0, "%s: Attempt to write " diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index 4515bea0268f..df6628469347 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c @@ -1153,7 +1153,7 @@ int jffs2_nand_flash_setup(struct jffs2_sb_info *c) /* Cleanmarker is out-of-band, so inline size zero */ c->cleanmarker_size = 0; - if (!oinfo || oinfo->oobavail == 0) { + if (!oinfo /* || oinfo->oobavail == 0 */) { printk(KERN_ERR "inconsistent device description\n"); return -EINVAL; }