Merge tag 'for-linus-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw...
[sfrench/cifs-2.6.git] / drivers / mtd / ubi / wl.c
index 27636063ed1bb1358ac4daf84713d1ac92c99719..42cac572f82dc59f4719a5cc3a178a6a04e54370 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.
                         */