]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
f2fs: fix wrong layout information on 16KB page
authorJaegeuk Kim <jaegeuk@kernel.org>
Tue, 9 Sep 2025 00:26:06 +0000 (00:26 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:21 +0000 (15:34 -0500)
[ Upstream commit a33be64b98d0723748d2fab0832b926613e1fce0 ]

This patch fixes to support different block size.

Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/sysfs.c

index eb84b9418ac1144f65b0e9d8c9e86769f94d0701..b3c04ecc3a2711d35d97b9a22b60903e6cfd3012 100644 (file)
@@ -1623,12 +1623,15 @@ static int __maybe_unused disk_map_seq_show(struct seq_file *seq,
        seq_printf(seq, " Main          : 0x%010x (%10d)\n",
                        SM_I(sbi)->main_blkaddr,
                        le32_to_cpu(F2FS_RAW_SUPER(sbi)->segment_count_main));
-       seq_printf(seq, " # of Sections : %12d\n",
-                       le32_to_cpu(F2FS_RAW_SUPER(sbi)->section_count));
+       seq_printf(seq, " Block size    : %12lu KB\n", F2FS_BLKSIZE >> 10);
+       seq_printf(seq, " Segment size  : %12d MB\n",
+                       (BLKS_PER_SEG(sbi) << (F2FS_BLKSIZE_BITS - 10)) >> 10);
        seq_printf(seq, " Segs/Sections : %12d\n",
                        SEGS_PER_SEC(sbi));
        seq_printf(seq, " Section size  : %12d MB\n",
-                       SEGS_PER_SEC(sbi) << 1);
+                       (BLKS_PER_SEC(sbi) << (F2FS_BLKSIZE_BITS - 10)) >> 10);
+       seq_printf(seq, " # of Sections : %12d\n",
+                       le32_to_cpu(F2FS_RAW_SUPER(sbi)->section_count));
 
        if (!f2fs_is_multi_device(sbi))
                return 0;