Message ID | 20231118020309.1894531-2-drosen@google.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | F2FS Tools 16K Bug Fixes | expand |
On 2023/11/18 10:03, Daniel Rosenberg wrote: > The conversion from block size to MB in this debug statement assumes a > block size of 4K. This switches it to properly use the filesystem's > block size. > > Signed-off-by: Daniel Rosenberg <drosen@google.com> Reviewed-by: Chao Yu <chao@kernel.org> Thanks,
diff --git a/fsck/fsck.c b/fsck/fsck.c index 55eddca..509b485 100644 --- a/fsck/fsck.c +++ b/fsck/fsck.c @@ -3494,7 +3494,8 @@ int fsck_verify(struct f2fs_sb_info *sbi) max_blks = SM_I(sbi)->main_blkaddr + (data_secs + node_secs) * BLKS_PER_SEC(sbi); printf("[FSCK] Max image size: %"PRIu64" MB, Free space: %"PRIu64" MB\n", - max_blks >> 8, free_blks >> 8); + max_blks >> (20 - F2FS_BLKSIZE_BITS), + free_blks >> (20 - F2FS_BLKSIZE_BITS)); printf("[FSCK] Unreachable nat entries "); if (nr_unref_nid == 0x0) { printf(" [Ok..] [0x%x]\n", nr_unref_nid);
The conversion from block size to MB in this debug statement assumes a block size of 4K. This switches it to properly use the filesystem's block size. Signed-off-by: Daniel Rosenberg <drosen@google.com> --- fsck/fsck.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)