UBI: Fastmap: Notify user in case of an ubi_update_fastmap() failure
[firefly-linux-kernel-4.4.55.git] / drivers / mtd / ubi / wl.c
index 11e0d7523d14792c038012484b02acdc5e7144ee..b9b7f97db83760eb85bb05c42960969c6b966851 100644 (file)
@@ -654,7 +654,11 @@ again:
         * refill the WL pool synchronous. */
        if (pool->used == pool->size || wl_pool->used == wl_pool->size) {
                spin_unlock(&ubi->wl_lock);
-               ubi_update_fastmap(ubi);
+               ret = ubi_update_fastmap(ubi);
+               if (ret) {
+                       ubi_msg(ubi, "Unable to write a new fastmap: %i", ret);
+                       return -ENOSPC;
+               }
                spin_lock(&ubi->wl_lock);
        }