All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs-tools: show segment/section layout correctly
@ 2022-05-13 16:50 Jaegeuk Kim
  0 siblings, 0 replies; only message in thread
From: Jaegeuk Kim @ 2022-05-13 16:50 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: Jaegeuk Kim

This patch fixes wrong segment/section print-outs.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fsck/mount.c  | 2 ++
 lib/libf2fs.c | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/fsck/mount.c b/fsck/mount.c
index b1e318f099f0..108e1238493d 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -1082,6 +1082,8 @@ int init_sb_info(struct f2fs_sb_info *sbi)
 	}
 
 	total_sectors = get_sb(block_count) << sbi->log_sectors_per_block;
+	MSG(0, "Info: Segments per section = %d\n", sbi->segs_per_sec);
+	MSG(0, "Info: Sections per zone = %d\n", sbi->secs_per_zone);
 	MSG(0, "Info: total FS sectors = %"PRIu64" (%"PRIu64" MB)\n",
 				total_sectors, total_sectors >>
 						(20 - get_sb(log_sectorsize)));
diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index afdbbbe17d84..961e70cb7b1b 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -1272,6 +1272,9 @@ int f2fs_get_f2fs_info(void)
 
 	c.segs_per_zone = c.segs_per_sec * c.secs_per_zone;
 
+	if (c.func != MKFS)
+		return 0;
+
 	MSG(0, "Info: Segments per section = %d\n", c.segs_per_sec);
 	MSG(0, "Info: Sections per zone = %d\n", c.secs_per_zone);
 	MSG(0, "Info: sector size = %u\n", c.sector_size);
-- 
2.36.0.550.gb090851708-goog



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-13 16:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 16:50 [f2fs-dev] [PATCH] f2fs-tools: show segment/section layout correctly Jaegeuk Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.