Skip to content

Commit

Permalink
UBI: Fastmap: Fall back to scanning mode after ECC error
Browse files Browse the repository at this point in the history
If we encounter an uncorrectable ECC error while scanning for the fastmap
UBI must not fail hard. Instead fall back to scanning mode.

Reported-by: Alexander Block <Alexander.Block@continental-corporation.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Richard Weinberger committed Mar 26, 2015
1 parent 56794c0 commit 180a535
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 @@ -1419,7 +1419,7 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
err = scan_all(ubi, ai, 0);
else {
err = scan_fast(ubi, &ai);
if (err > 0) {
if (err > 0 || mtd_is_eccerr(err)) {
if (err != UBI_NO_FASTMAP) {
destroy_ai(ai);
ai = alloc_ai();
Expand Down

0 comments on commit 180a535

Please sign in to comment.