summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu CASTET <matthieu.castet@parrot.com>2012-08-22 16:03:46 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-07 08:35:56 -0700
commite66cc3f3418b78818498d3dd2561e6d1c489aa03 (patch)
tree00503db298051b0f8824a2cd43fe3a8cf8dd8d6c
parent905c44046f28fa8310ed74c7e460548da96d38fc (diff)
UBI: erase free PEB with bitflip in EC header
commit 193819cf2e6e395b1e1be2d36785dc5563a6edca upstream. Without this patch, these PEB are not scrubbed until we put data in them. Bitflip can accumulate latter and we can loose the EC header (but VID header should be intact and allow to recover data). Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/mtd/ubi/attach.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/ubi/attach.c b/drivers/mtd/ubi/attach.c
index bd27cbbb4066..68d4d1f76d1e 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -975,7 +975,7 @@ static int scan_peb(struct ubi_device *ubi, struct ubi_attach_info *ai,
return err;
goto adjust_mean_ec;
case UBI_IO_FF:
- if (ec_err)
+ if (ec_err || bitflips)
err = add_to_list(ai, pnum, UBI_UNKNOWN,
UBI_UNKNOWN, ec, 1, &ai->erase);
else