Skip to contentSkip to conversation

f2fs: bugon w/ SBI_NEED_FSCK when has CONFIG_F2FS_CHECK_FS

PATCH New Yangtao Li 1 participant 1 message Feb 16, 2023 F2FS file system

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 f2fs: bugon w/ SBI_NEED_FSCK when has CONFIG_F2FS_CHECK_FS

The SBI_NEED_FSCK flag usually means that the data in the file system is abnormal, and the fsck tool needs to be used. When CONFIG_F2FS_CHECK_FS is enabled, let us trigger bug_on at the first moment when SBI_NEED_FSCK is set, so as to analyze the first scene.

---
 fs/f2fs/f2fs.h | 3 +++
 1 file changed, 3 insertions(+)
fs/f2fs/f2fs.h +3 -0
index 21596e0266ba..055bb7246a1f 100644
@@ -2074,6 +2074,9 @@ static inline bool is_sbi_flag_set(struct f2fs_sb_info *sbi, unsigned int type)
 
 static inline void set_sbi_flag(struct f2fs_sb_info *sbi, unsigned int type)
 {
+#ifdef CONFIG_F2FS_CHECK_FS
+	f2fs_bug_on(sbi, type == SBI_NEED_FSCK);
+#endif
 	set_bit(type, &sbi->s_flag);
 }
 
Signature · 8 lines
2.25.1



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