]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
f2fs: fix uninitialized skipped_gc_rwsem
authorYonggil Song <yonggil.song@samsung.com>
Thu, 16 Feb 2023 07:13:50 +0000 (16:13 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:11:10 +0000 (23:11 +0900)
commita847b4c4acf16af7f189331f85bf5684ca2f77c1
treeed4443527e3f670d26979abe6a62537bc98ab1ca
parent48b2b82f98ac9a9aa0ba2ced3ee1893184daa40f
f2fs: fix uninitialized skipped_gc_rwsem

[ Upstream commit c17caf0ba3aa3411b96c71b4ce24be1040b8f3e8 ]

When f2fs skipped a gc round during victim migration, there was a bug which
would skip all upcoming gc rounds unconditionally because skipped_gc_rwsem
was not initialized. It fixes the bug by correctly initializing the
skipped_gc_rwsem inside the gc loop.

Fixes: 6f8d4455060d ("f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc")
Signed-off-by: Yonggil Song <yonggil.song@samsung.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/gc.c