UBI: Fastmap: Notify user in case of an ubi_update_fastmap() failure
If ubi_update_fastmap() fails notify the user. This is not a hard error as ubi_update_fastmap() makes sure that upon failure the current on-flash fastmap will no be used upon next UBI attach. Signed-off-by: Richard Weinberger <richard@nod.at> Conflicts: drivers/mtd/ubi/wl.c Fixed minor conflict. Signed-off-by: Teresa Remmet <t.remmet@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
bb1a98cc18
commit
e8957c2033
|
@ -615,9 +615,15 @@ int ubi_wl_get_peb(struct ubi_device *ubi)
|
||||||
struct ubi_fm_pool *pool = &ubi->fm_pool;
|
struct ubi_fm_pool *pool = &ubi->fm_pool;
|
||||||
struct ubi_fm_pool *wl_pool = &ubi->fm_wl_pool;
|
struct ubi_fm_pool *wl_pool = &ubi->fm_wl_pool;
|
||||||
|
|
||||||
if (!pool->size || !wl_pool->size || pool->used == pool->size ||
|
/* We check here also for the WL pool because at this point we can
|
||||||
wl_pool->used == wl_pool->size)
|
* refill the WL pool synchronous. */
|
||||||
ubi_update_fastmap(ubi);
|
if (pool->used == pool->size || wl_pool->used == wl_pool->size) {
|
||||||
|
ret = ubi_update_fastmap(ubi);
|
||||||
|
if (ret) {
|
||||||
|
ubi_msg(ubi, "Unable to write a new fastmap: %i", ret);
|
||||||
|
return -ENOSPC;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* we got not a single free PEB */
|
/* we got not a single free PEB */
|
||||||
if (!pool->size)
|
if (!pool->size)
|
||||||
|
|
Loading…
Reference in New Issue