From: Richard Weinberger Date: Tue, 7 Oct 2014 19:45:19 +0000 (+0200) Subject: UBI: Fastmap: Switch to ro mode if invalidate_fastmap() fails X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2d93fb3632755c170bc684989709e28ef3d22a80;p=linux-beck.git UBI: Fastmap: Switch to ro mode if invalidate_fastmap() fails We have to switch to ro mode to guarantee that upon next UBI attach all data is consistent. Signed-off-by: Richard Weinberger --- diff --git a/drivers/mtd/ubi/fastmap.c b/drivers/mtd/ubi/fastmap.c index 8b95c48a002d..3d913f53fd06 100644 --- a/drivers/mtd/ubi/fastmap.c +++ b/drivers/mtd/ubi/fastmap.c @@ -1466,8 +1466,10 @@ err: ret = 0; if (old_fm) { ret = invalidate_fastmap(ubi, old_fm); - if (ret < 0) + if (ret < 0) { ubi_err(ubi, "Unable to invalidiate current fastmap!"); + ubi_ro_mode(ubi); + } else if (ret) ret = 0; }