This is a note to let you know that I've just added the patch titled

    JFFS2: don't fail on bitflips in OOB

to the 3.4-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     jffs2-don-t-fail-on-bitflips-in-oob.patch
and it can be found in the queue-3.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 74d83beaa229aac7d126ac1ed9414658ff1a89d2 Mon Sep 17 00:00:00 2001
From: Brian Norris <[email protected]>
Date: Fri, 31 Aug 2012 15:01:19 -0700
Subject: JFFS2: don't fail on bitflips in OOB

From: Brian Norris <[email protected]>

commit 74d83beaa229aac7d126ac1ed9414658ff1a89d2 upstream.

JFFS2 was designed without thought for OOB bitflips, it seems, but they
can occur and will be reported to JFFS2 via mtd_read_oob()[1]. We don't
want to fail on these transactions, since the data was corrected.

[1] Few drivers report bitflips for OOB-only transactions. With such
    drivers, this patch should have no effect.

Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 fs/jffs2/wbuf.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
@@ -1043,10 +1043,10 @@ int jffs2_check_oob_empty(struct jffs2_s
        ops.datbuf = NULL;
 
        ret = mtd_read_oob(c->mtd, jeb->offset, &ops);
-       if (ret || ops.oobretlen != ops.ooblen) {
+       if ((ret && !mtd_is_bitflip(ret)) || ops.oobretlen != ops.ooblen) {
                pr_err("cannot read OOB for EB at %08x, requested %zd bytes, 
read %zd bytes, error %d\n",
                       jeb->offset, ops.ooblen, ops.oobretlen, ret);
-               if (!ret)
+               if (!ret || mtd_is_bitflip(ret))
                        ret = -EIO;
                return ret;
        }
@@ -1085,10 +1085,10 @@ int jffs2_check_nand_cleanmarker(struct
        ops.datbuf = NULL;
 
        ret = mtd_read_oob(c->mtd, jeb->offset, &ops);
-       if (ret || ops.oobretlen != ops.ooblen) {
+       if ((ret && !mtd_is_bitflip(ret)) || ops.oobretlen != ops.ooblen) {
                pr_err("cannot read OOB for EB at %08x, requested %zd bytes, 
read %zd bytes, error %d\n",
                       jeb->offset, ops.ooblen, ops.oobretlen, ret);
-               if (!ret)
+               if (!ret || mtd_is_bitflip(ret))
                        ret = -EIO;
                return ret;
        }


Patches currently in stable-queue which might be from 
[email protected] are

queue-3.4/jffs2-don-t-fail-on-bitflips-in-oob.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to