]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
f2fs: fix to shrink read extent node in batches
authorChao Yu <chao@kernel.org>
Thu, 21 Nov 2024 01:57:50 +0000 (09:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:04:05 +0000 (20:04 +0100)
commit924f7dd1e832e4e4530d14711db223d2803f7b61
tree65c7b13871866665a64166e88e8ff02e116008ab
parent6d41a2d5c168c3fcfa10fd35428bd146652a52cf
f2fs: fix to shrink read extent node in batches

[ Upstream commit 3fc5d5a182f6a1f8bd4dc775feb54c369dd2c343 ]

We use rwlock to protect core structure data of extent tree during
its shrink, however, if there is a huge number of extent nodes in
extent tree, during shrink of extent tree, it may hold rwlock for
a very long time, which may trigger kernel hang issue.

This patch fixes to shrink read extent node in batches, so that,
critical region of the rwlock can be shrunk to avoid its extreme
long time hold.

Reported-by: Xiuhong Wang <xiuhong.wang@unisoc.com>
Closes: https://lore.kernel.org/linux-f2fs-devel/20241112110627.1314632-1-xiuhong.wang@unisoc.com/
Signed-off-by: Xiuhong Wang <xiuhong.wang@unisoc.com>
Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/extent_cache.c