f2fs-tools: show segment/section layout correctly

commit 3af62be37cd2407da1f44396cd9390bd560ed01f
category: bugfix
issue: #I6VAS0
CVE: NA

Signed-off-by: DongSenhao <dongsenhao2@huawei.com>
---------------------------------------

This patch fixes wrong segment/section print-outs.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: dongsenhao <dongsenhao2@huawei.com>
This commit is contained in:
Jaegeuk Kim 2022-04-26 16:55:51 -07:00 committed by dongsenhao
parent 43aa4d3b7b
commit b844b4b34c
2 changed files with 5 additions and 0 deletions

View File

@ -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)));

View File

@ -1274,6 +1274,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);