]> git.hungrycats.org Git - linux/commit
ubi: fastmap: wl: Schedule fm_work if wear-leveling pool is empty
authorZhihao Cheng <chengzhihao1@huawei.com>
Mon, 19 Aug 2024 03:26:22 +0000 (11:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:54:28 +0000 (13:54 +0100)
commitec869b6ae9a99cb02cb761b46f36acfcfdc3b5e1
treeddefecf9c0d7b4534bcea2a23c4088dd6ed96862
parenta1f0b4af90cc18b10261ecde56c6a56b22c75bd1
ubi: fastmap: wl: Schedule fm_work if wear-leveling pool is empty

[ Upstream commit c4595fe394a289927077e3da561db27811919ee0 ]

Since commit 14072ee33d5a ("ubi: fastmap: Check wl_pool for free peb
before wear leveling"), wear_leveling_worker() won't schedule fm_work
if wear-leveling pool is empty, which could temporarily disable the
wear-leveling until the fastmap is updated(eg. pool becomes empty).
Fix it by scheduling fm_work if wl_pool is empty during wear-leveing.

Fixes: 14072ee33d5a ("ubi: fastmap: Check wl_pool for free peb before wear leveling")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mtd/ubi/fastmap-wl.c
drivers/mtd/ubi/wl.c
drivers/mtd/ubi/wl.h