9
0
Fork 0

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>
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Richard Weinberger 2016-05-27 09:44:23 +02:00 committed by Sascha Hauer
parent 75abea1602
commit b98122916a
1 changed files with 3 additions and 1 deletions

View File

@ -1458,8 +1458,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;
}