diff options
author | Theodore Ts'o <tytso@mit.edu> | 2011-06-16 01:38:43 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-06-16 01:38:43 -0400 |
commit | fe75afbf33389f71f8588af388d0c01db0cbf753 (patch) | |
tree | b2fd6e1a157b717842c3fbd533b529ba9b92e954 /misc | |
parent | a3efe4842054175d01b465fbe0b29b9be8b800a1 (diff) | |
download | e2fsprogs-fe75afbf33389f71f8588af388d0c01db0cbf753.tar.gz |
Fix superblock field s_blocks_count for bigalloc file systems
Treat the s_blocks_count field in the superblock as a free block count
(instead of the number of free clusters) for bigalloc file systems.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'misc')
-rw-r--r-- | misc/mke2fs.c | 2 | ||||
-rw-r--r-- | misc/tune2fs.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/misc/mke2fs.c b/misc/mke2fs.c index 7e0cc34e..788e0fc2 100644 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@ -2134,7 +2134,7 @@ static void fix_cluster_bg_counts(ext2_filsys fs) group++; } } - ext2fs_free_blocks_count_set(fs->super, tot_free); + ext2fs_free_blocks_count_set(fs->super, EXT2FS_C2B(fs, tot_free)); } int main (int argc, char *argv[]) diff --git a/misc/tune2fs.c b/misc/tune2fs.c index 3f7e7e75..d7cb124c 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -265,7 +265,7 @@ static int release_blocks_proc(ext2_filsys fs, blk64_t *blocknr, group = ext2fs_group_of_blk2(fs, block); ext2fs_bg_free_blocks_count_set(fs, group, ext2fs_bg_free_blocks_count(fs, group) + 1); ext2fs_group_desc_csum_set(fs, group); - ext2fs_free_blocks_count_add(fs->super, 1); + ext2fs_free_blocks_count_add(fs->super, EXT2FS_CLUSTER_RATIO(fs)); return 0; } @@ -1402,6 +1402,7 @@ static errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs) group_free = 0; } } + total_free = EXT2FS_C2B(fs, total_free); ext2fs_free_blocks_count_set(fs->super, total_free); /* |