aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunling Zheng <zhengjunling@huawei.com>2016-02-27 10:43:08 +0800
committerluca020400 <luca.stefani.ge1@gmail.com>2016-04-04 17:17:55 +0200
commitec90e1f6509002115e623a82cc077970848af4e0 (patch)
treef162a6db6453087e9b0cb74b4089e7a22825064f
parent2165e06cba6402243db1abe39a641a74894ab225 (diff)
downloadandroid_external_f2fs-tools-ec90e1f6509002115e623a82cc077970848af4e0.tar.gz
android_external_f2fs-tools-ec90e1f6509002115e623a82cc077970848af4e0.tar.bz2
android_external_f2fs-tools-ec90e1f6509002115e623a82cc077970848af4e0.zip
fsck.f2fs: calculate the total size correctly
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>
-rw-r--r--fsck/mount.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fsck/mount.c b/fsck/mount.c
index ec040c8..7c57930 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -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;
}