Skip to contentSkip to conversation

f2fs: allow dirty sections with zero valid block for checkpoint disabled

PATCH Superseded Daeho Jeong 2 participants 2 messages May 7, 2024 – May 9, 2024 F2FS file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: allow dirty sections with zero valid block for checkpoint disabled

From: Daeho Jeong <[email protected]>

Following the semantic for dirty segments in checkpoint disabled mode, apply the same rule to dirty sections.

---
 fs/f2fs/segment.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
fs/f2fs/segment.c +5 -2
index 6474b7338e81..2463398b243f 100644
@@ -771,8 +771,11 @@ 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)));
+			if (!is_sbi_flag_set(sbi, SBI_CP_DISABLED))
+				f2fs_bug_on(sbi, unlikely(!valid_blocks));
+
+			f2fs_bug_on(sbi, unlikely(valid_blocks ==
+					CAP_BLKS_PER_SEC(sbi)));
 
 			if (!IS_CURSEC(sbi, secno))
 				set_bit(secno, dirty_i->dirty_secmap);
Signature · 1 line
2.45.0.rc1.225.g2a3ae87e7f-goog
maintainer
#1 lore raw
Quoted 15 lines · Daeho Jeong

From: Daeho Jeong <[email protected]>

Following the semantic for dirty segments in checkpoint disabled mode, apply the same rule to dirty sections.

---
 fs/f2fs/segment.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
fs/f2fs/segment.c +0 -0
index 6474b7338e81..2463398b243f 100644

fs/f2fs/segment.c static void __locate_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno, · line 778

Quoted 10 lines
fs/f2fs/segment.c +5 -2
@@ -771,8 +771,11 @@ 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)));
+			if (!is_sbi_flag_set(sbi, SBI_CP_DISABLED))
+				f2fs_bug_on(sbi, unlikely(!valid_blocks));
+
+			f2fs_bug_on(sbi, unlikely(valid_blocks ==
+					CAP_BLKS_PER_SEC(sbi)));

What about:
f2fs_bug_on(sbi,

	(!is_sbi_flag_set(sbi, SBI_CP_DISABLED) && !valid_blocks) ||
	valid_blocks == CAP_BLKS_PER_SEC(sbi));
Quoted 12 lines
fs/f2fs/segment.c +0 -0
 			if (!IS_CURSEC(sbi, secno))
 				set_bit(secno, dirty_i->dirty_secmap);
Signature · 8 lines
2.45.0.rc1.225.g2a3ae87e7f-goog



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel