Skip to content

Commit

Permalink
UBI: erase free PEB with bitflip in EC header
Browse files Browse the repository at this point in the history
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>
Cc: stable@vger.kernel.org
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
Matthieu CASTET authored and Artem Bityutskiy committed Sep 4, 2012
1 parent abb3e01 commit 193819c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/ubi/attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 193819c

Please sign in to comment.