Merge tag '9p-for-5.9-rc1' of git://github.com/martinetd/linux
[linux-2.6-microblaze.git] / drivers / mtd / ubi / wl.c
index 2763606..42cac57 100644 (file)
@@ -1086,7 +1086,8 @@ static int __erase_worker(struct ubi_device *ubi, struct ubi_work *wl_wrk)
        if (!err) {
                spin_lock(&ubi->wl_lock);
 
-               if (!ubi->fm_next_anchor && e->pnum < UBI_FM_MAX_START) {
+               if (!ubi->fm_disabled && !ubi->fm_next_anchor &&
+                   e->pnum < UBI_FM_MAX_START) {
                        /* Abort anchor production, if needed it will be
                         * enabled again in the wear leveling started below.
                         */