Skip to contentSkip to conversation

f2fs: show sbi status in debugfs/f2f/sstatus

PATCH In review Jaegeuk Kim 2 participants 3 messages Jul 30, 2021 – Jul 31, 2021 F2FS file system

lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: show sbi status in debugfs/f2f/sstatus

We need to get sbi->s_flag to understand the current f2fs status as well. One example is SBI_NEED_FSCK.

---
 fs/f2fs/debug.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/f2fs/debug.c +3 -2
index 53ed1e9191f0..473ad04d1891 100644
@@ -333,11 +333,12 @@ static int stat_show(struct seq_file *s, void *v)
 	list_for_each_entry(si, &f2fs_stat_list, stat_list) {
 		update_general_status(si->sbi);
 
-		seq_printf(s, "\n=====[ partition info(%pg). #%d, %s, CP: %s]=====\n",
+		seq_printf(s, "\n=====[ partition info(%pg). #%d, %s, CP: %s (sbi: 0x%lx)]=====\n",
 			si->sbi->sb->s_bdev, i++,
 			f2fs_readonly(si->sbi->sb) ? "RO": "RW",
 			is_set_ckpt_flags(si->sbi, CP_DISABLED_FLAG) ?
-			"Disabled": (f2fs_cp_error(si->sbi) ? "Error": "Good"));
+			"Disabled": (f2fs_cp_error(si->sbi) ? "Error": "Good"),
+			si->sbi->s_flag);
 		seq_printf(s, "[SB: 1] [CP: 2] [SIT: %d] [NAT: %d] ",
 			   si->sit_area_segs, si->nat_area_segs);
 		seq_printf(s, "[SSA: %d] [MAIN: %d",
Signature · 1 line
2.32.0.554.ge1b32706d8-goog
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Jaegeuk Kim

We need to get sbi->s_flag to understand the current f2fs status as well. One example is SBI_NEED_FSCK.

Typo in patch title: "f2f/sstatus".

Please note that there is a sysfs entry /sys/fs/f2fs/<devname/stat/sb_status.

Quoted 2 lines

Thanks,

author maintainer
#2 lore raw
Quoted 7 lines · Chao Yu
Quoted 2 lines · Jaegeuk Kim

We need to get sbi->s_flag to understand the current f2fs status as well. One example is SBI_NEED_FSCK.

Typo in patch title: "f2f/sstatus".

Please note that there is a sysfs entry /sys/fs/f2fs/<devname/stat/sb_status.

Sure. Thanks.

Quoted 7 lines
Quoted 3 lines

Thanks,