Skip to content

Commit b72f78c

Browse files
Eric Sandeentytso
authored andcommitted
ext4: fix overhead calculations in ext4_stats, again
"overhead" was a write-only variable in this function after commit 952fc18; we set it to 0 for minixdf, or to sbi->s_overhead if !minixdf, but never read it again after that. We need to use it, not sbi->s_overhead, when subtracting out overhead for f_blocks, or we get the wrong answer for minixdf. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
1 parent ffb5387 commit b72f78c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/ext4/super.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4790,7 +4790,7 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf)
47904790

47914791
buf->f_type = EXT4_SUPER_MAGIC;
47924792
buf->f_bsize = sb->s_blocksize;
4793-
buf->f_blocks = ext4_blocks_count(es) - EXT4_C2B(sbi, sbi->s_overhead);
4793+
buf->f_blocks = ext4_blocks_count(es) - EXT4_C2B(sbi, overhead);
47944794
bfree = percpu_counter_sum_positive(&sbi->s_freeclusters_counter) -
47954795
percpu_counter_sum_positive(&sbi->s_dirtyclusters_counter);
47964796
/* prevent underflow in case that few free space is available */

0 commit comments

Comments
 (0)