ubi: fastmap: Check wl_pool for free peb before wear leveling
authorZhihao Cheng <chengzhihao1@huawei.com>
Tue, 10 May 2022 12:31:25 +0000 (20:31 +0800)
committerRichard Weinberger <richard@nod.at>
Fri, 27 May 2022 14:49:07 +0000 (16:49 +0200)
commit14072ee33d5a2a07d735b667205f99d0a95de9f2
tree029651d653978cf6f28c767f4f43a2b4a29b25f6
parentd09e9a2bddba6c48e0fddb16c4383172ac593251
ubi: fastmap: Check wl_pool for free peb before wear leveling

UBI fetches free peb from wl_pool during wear leveling, so UBI should
check wl_pool's empty status before wear leveling. Otherwise, UBI will
miss wear leveling chances when free pebs are run out.

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/ubi/fastmap-wl.c
drivers/mtd/ubi/wl.c
drivers/mtd/ubi/wl.h