From: Richard Weinberger Date: Mon, 9 Mar 2015 09:04:09 +0000 (+0100) Subject: UBI: Fastmap: Fall back to scanning mode after ECC error X-Git-Tag: v4.1-rc1~122^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=180a53577b809026af744e99a35b3a3a0056520b;p=karo-tx-linux.git 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 Signed-off-by: Richard Weinberger --- 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) 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();