aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2015-03-09 05:04:09 -0400
committerRichard Weinberger <richard@nod.at>2015-03-26 18:03:15 -0400
commit180a53577b809026af744e99a35b3a3a0056520b (patch)
treeb10189a9df5f961bfbdf42db646b84925c273ac6
parent56794c0a1ae738cb4184ab27501e4d152b0b2771 (diff)
UBI: Fastmap: Fall back to scanning mode after ECC error
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>
-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 42d465add385..68eea5befaf1 100644
--- a/drivers/mtd/ubi/attach.c
+++ b/drivers/mtd/ubi/attach.c
@@ -1419,7 +1419,7 @@ int ubi_attach(struct ubi_device *ubi, int force_scan)
1419 err = scan_all(ubi, ai, 0); 1419 err = scan_all(ubi, ai, 0);
1420 else { 1420 else {
1421 err = scan_fast(ubi, &ai); 1421 err = scan_fast(ubi, &ai);
1422 if (err > 0) { 1422 if (err > 0 || mtd_is_eccerr(err)) {
1423 if (err != UBI_NO_FASTMAP) { 1423 if (err != UBI_NO_FASTMAP) {
1424 destroy_ai(ai); 1424 destroy_ai(ai);
1425 ai = alloc_ai(); 1425 ai = alloc_ai();