aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2012-08-31 18:01:19 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-09-29 10:34:13 -0400
commit74d83beaa229aac7d126ac1ed9414658ff1a89d2 (patch)
tree72100bf61281de2d6201c7d8e31ea2e4de5d209b /fs/jffs2
parent6f12f59a5f0dc014209bcc21d5689a6611e1c1e7 (diff)
JFFS2: don't fail on bitflips in OOB
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 <computersforpeace@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/wbuf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
index 6f4529d3697f..a6597d60d76d 100644
--- a/fs/jffs2/wbuf.c
+++ b/fs/jffs2/wbuf.c
@@ -1044,10 +1044,10 @@ int jffs2_check_oob_empty(struct jffs2_sb_info *c,
1044 ops.datbuf = NULL; 1044 ops.datbuf = NULL;
1045 1045
1046 ret = mtd_read_oob(c->mtd, jeb->offset, &ops); 1046 ret = mtd_read_oob(c->mtd, jeb->offset, &ops);
1047 if (ret || ops.oobretlen != ops.ooblen) { 1047 if ((ret && !mtd_is_bitflip(ret)) || ops.oobretlen != ops.ooblen) {
1048 pr_err("cannot read OOB for EB at %08x, requested %zd bytes, read %zd bytes, error %d\n", 1048 pr_err("cannot read OOB for EB at %08x, requested %zd bytes, read %zd bytes, error %d\n",
1049 jeb->offset, ops.ooblen, ops.oobretlen, ret); 1049 jeb->offset, ops.ooblen, ops.oobretlen, ret);
1050 if (!ret) 1050 if (!ret || mtd_is_bitflip(ret))
1051 ret = -EIO; 1051 ret = -EIO;
1052 return ret; 1052 return ret;
1053 } 1053 }
@@ -1086,10 +1086,10 @@ int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c,
1086 ops.datbuf = NULL; 1086 ops.datbuf = NULL;
1087 1087
1088 ret = mtd_read_oob(c->mtd, jeb->offset, &ops); 1088 ret = mtd_read_oob(c->mtd, jeb->offset, &ops);
1089 if (ret || ops.oobretlen != ops.ooblen) { 1089 if ((ret && !mtd_is_bitflip(ret)) || ops.oobretlen != ops.ooblen) {
1090 pr_err("cannot read OOB for EB at %08x, requested %zd bytes, read %zd bytes, error %d\n", 1090 pr_err("cannot read OOB for EB at %08x, requested %zd bytes, read %zd bytes, error %d\n",
1091 jeb->offset, ops.ooblen, ops.oobretlen, ret); 1091 jeb->offset, ops.ooblen, ops.oobretlen, ret);
1092 if (!ret) 1092 if (!ret || mtd_is_bitflip(ret))
1093 ret = -EIO; 1093 ret = -EIO;
1094 return ret; 1094 return ret;
1095 } 1095 }