]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
let JFFS2 work without OOB
authorLothar Waßmann <LW@KARO-electronics.de>
Sat, 25 May 2013 14:38:52 +0000 (16:38 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 29 Oct 2013 11:54:19 +0000 (12:54 +0100)
drivers/mtd/nand/nand_base.c
fs/jffs2/wbuf.c

index c2dc1f0de79c1b73cc8b4fec34b8d650a069b971..aedabe0d853282062bba6c2b3b4bae194c186b45 100644 (file)
@@ -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 "
index 4515bea0268fa6ac17f8b2d61bd818bea42b6674..df6628469347c5394a090c069a18866ac5b4cec6 100644 (file)
@@ -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;
        }