summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi/fastmap.c
diff options
context:
space:
mode:
authorRichard Weinberger <richard@nod.at>2014-10-07 23:45:19 +0400
committerRichard Weinberger <richard@nod.at>2015-03-27 00:45:59 +0300
commit2d93fb3632755c170bc684989709e28ef3d22a80 (patch)
tree7aef6f769a109af63ebcad6c0994cd30bd863a82 /drivers/mtd/ubi/fastmap.c
parentd141a8ef21ab496ab6f8d188dfe7ca33e16fe798 (diff)
downloadlinux-2d93fb3632755c170bc684989709e28ef3d22a80.tar.xz
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 <richard@nod.at>
Diffstat (limited to 'drivers/mtd/ubi/fastmap.c')
-rw-r--r--drivers/mtd/ubi/fastmap.c4
1 files changed, 3 insertions, 1 deletions
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;
}