diff options
author | Daeho Jeong <daehojeong@google.com> | 2024-05-10 06:49:08 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2024-05-11 00:39:07 +0000 |
commit | f2526c5cf1d94359467d9472387363d57c6b3e6d (patch) | |
tree | e9e97e20b93ec61a06cdd9d9aef09f6d7eca5b90 /fs/f2fs | |
parent | 29ed2b5dd521ce7c5d8466cd70bf0cc9d07afeee (diff) |
f2fs: allow dirty sections with zero valid block for checkpoint disabled
Following the semantic for dirty segments in checkpoint disabled mode,
apply the same rule to dirty sections.
Signed-off-by: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/segment.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index ab3e9a6e9c96..a0ce3d080f80 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -771,8 +771,10 @@ static void __locate_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno, block_t valid_blocks = get_valid_blocks(sbi, segno, true); - f2fs_bug_on(sbi, unlikely(!valid_blocks || - valid_blocks == CAP_BLKS_PER_SEC(sbi))); + f2fs_bug_on(sbi, + (!is_sbi_flag_set(sbi, SBI_CP_DISABLED) && + !valid_blocks) || + valid_blocks == CAP_BLKS_PER_SEC(sbi)); if (!IS_CURSEC(sbi, secno)) set_bit(secno, dirty_i->dirty_secmap); |