1 ext4: don't count external journal blocks as overhead
3 From: Eric Sandeen <sandeen@redhat.com>
5 This was fixed for ext3 with:
7 e6d8fb3 ext3: Count internal journal as bsddf overhead in ext3_statfs
9 but was never fixed for ext4.
11 With a large external journal and no used disk blocks, df comes
12 out negative without this, as journal blocks are added to the
13 overhead & subtracted from used blocks unconditionally.
15 Signed-off-by: Eric Sandeen <sandeen@redhat.com>
16 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
19 ps: since this is stored in the on-disk superblock now, I'm not
20 sure how to fix up old filesystems, or if it matters much.
22 diff --git a/fs/ext4/super.c b/fs/ext4/super.c
23 index 2c9e686..9674578 100644
26 @@ -3338,8 +3338,8 @@ int ext4_calculate_overhead(struct super_block *sb)
27 memset(buf, 0, PAGE_SIZE);
30 - /* Add the journal blocks as well */
32 + /* Add the internal journal blocks as well */
33 + if (sbi->s_journal && !sbi->journal_bdev)
34 overhead += EXT4_NUM_B2C(sbi, sbi->s_journal->j_maxlen);
36 sbi->s_overhead = overhead;
39 To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
40 the body of a message to majordomo@vger.kernel.org
41 More majordomo info at http://vger.kernel.org/majordomo-info.html