]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
f2fs: fix to not account invalid blocks in get_left_section_blocks()
authorChao Yu <chao@kernel.org>
Fri, 28 Nov 2025 09:25:07 +0000 (17:25 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:18 +0000 (12:57 +0100)
commit51659b91898f2bc4441d597042223e1b644237fc
treeacffc89636f9bf65ffdfccf8b8b82a73868f320b
parent2efb6b9c5bd27ff11abfc80e3b4ec59f3335c9d4
f2fs: fix to not account invalid blocks in get_left_section_blocks()

commit 37345eae9deaa2e4f372eeb98f6594cd0ee0916e upstream.

w/ LFS mode, in get_left_section_blocks(), we should not account the
blocks which were used before and now are invalided, otherwise those
blocks will be counted as freed one in has_curseg_enough_space(), result
in missing to trigger GC in time.

Cc: stable@kernel.org
Fixes: 249ad438e1d9 ("f2fs: add a method for calculating the remaining blocks in the current segment in LFS mode.")
Fixes: bf34c93d2645 ("f2fs: check curseg space before foreground GC")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/segment.h