fsck.f2fs: calculate the total size correctly
authorJunling Zheng <zhengjunling@huawei.com>
Sat, 27 Feb 2016 02:43:08 +0000 (10:43 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 29 Feb 2016 17:20:54 +0000 (09:20 -0800)
Correctly calculate the total FS size in init_sb_info(), for sector
size may not be 512 bytes.

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/mount.c

index ec040c8..7c57930 100644 (file)
@@ -367,7 +367,8 @@ int init_sb_info(struct f2fs_sb_info *sbi)
 
        total_sectors = get_sb(block_count) << sbi->log_sectors_per_block;
        MSG(0, "Info: total FS sectors = %"PRIu64" (%"PRIu64" MB)\n",
-                               total_sectors, total_sectors >> 11);
+                               total_sectors, total_sectors >>
+                                               (20 - get_sb(log_sectorsize)));
        return 0;
 }