summaryrefslogtreecommitdiff
path: root/include/mtd/git@git.tavy.me:linux-stable.git
diff options
context:
space:
mode:
authorDaeho Jeong <daehojeong@google.com>2026-03-16 11:59:21 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2026-04-02 16:24:19 +0000
commitdccd324fa9bd1a2907a63fa4cc2651f687b2b5d0 (patch)
tree2b2c575668b0bb36808a705d799ac944d0eb7ab5 /include/mtd/git@git.tavy.me:linux-stable.git
parentfe9b8b30b97102859a9102be7bd2a09803bd90bd (diff)
f2fs: fix to skip empty sections in f2fs_get_victim
In age-based victim selection (ATGC, AT_SSR, or GC_CB), f2fs_get_victim can encounter sections with zero valid blocks. This situation often arises when checkpoint is disabled or due to race conditions between SIT updates and dirty list management. In such cases, f2fs_get_section_mtime() returns INVALID_MTIME, which subsequently triggers a fatal f2fs_bug_on(sbi, mtime == INVALID_MTIME) in add_victim_entry() or get_cb_cost(). This patch adds a check in f2fs_get_victim's selection loop to skip sections with no valid blocks. This prevents unnecessary age calculations for empty sections and avoids the associated kernel panic. This change also allows removing redundant checks in add_victim_entry(). Signed-off-by: Daeho Jeong <daehojeong@google.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'include/mtd/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions