Skip to contentSkip to conversation

f2fs: fix the wrong f2fs_bug_on condition in f2fs_do_replace_block

PATCH Superseded LongPing Wei via Linux-f2fs-devel 1 participant 1 message Oct 20, 2024 F2FS file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: fix the wrong f2fs_bug_on condition in f2fs_do_replace_block

This f2fs_bug_on was introduced by commit 2c1905042c8c3("f2fs: check segment type in __f2fs_replace_block") when there were only 6 curseg types. After commit d0b9e42ab6155(f2fs: introduce inmem curseg) was introduced, the condition should be changed to checking curseg->seg_type.

Fixes d0b9e42ab6155("f2fs: introduce inmem curseg")
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/segment.c +1 -1
index 1766254279d2..7b54b1851d34 100644
@@ -3977,8 +3977,8 @@ void f2fs_do_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
 		}
 	}
 
-	f2fs_bug_on(sbi, !IS_DATASEG(type));
 	curseg = CURSEG_I(sbi, type);
+	f2fs_bug_on(sbi, !IS_DATASEG(curseg->seg_type));
 
 	mutex_lock(&curseg->curseg_mutex);
 	down_write(&sit_i->sentry_lock);
Signature · 8 lines
2.34.1



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