ext3: Count internal journal as bsddf overhead in ext3_statfs
PATCH 1/1 ext3: Count internal journal as bsddf overhead in ext3_statfs
The journal blocks of external journal device should not be counted as overhead.
Signed-off-by Chin-Tsung Cheng <[email protected]>
--- fs/ext3/super.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/ext3/super.c +3 -2
@@ -2828,8 +2828,9 @@ static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf)*/ overhead += ngroups * (2 + sbi->s_itb_per_group); -/* Add the journal blocks as well */ - overhead += sbi->s_journal->j_maxlen; +/* Add the internal journal blocks as well */ +if (sbi->s_journal && !sbi->journal_bdev) + overhead += sbi->s_journal->j_maxlen; sbi->s_overhead_last = overhead;smp_wmb ();
Signature · 1 line
1.9.3
Quoted 2 lines · Chin-Tsung Cheng
The journal blocks of external journal device should not be counted as overhead.
Thanks. I've added the patch to my tree.
Honza
Quoted 25 lines
Signed-off-by Chin-Tsung Cheng <[email protected]>--- fs/ext3/super.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)fs/ext3/super.c +3
-2@@ -2828,8 +2828,9 @@ static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf)*/ overhead += ngroups * (2 + sbi->s_itb_per_group); -/* Add the journal blocks as well */ - overhead += sbi->s_journal->j_maxlen; +/* Add the internal journal blocks as well */ +if (sbi->s_journal && !sbi->journal_bdev) + overhead += sbi->s_journal->j_maxlen; sbi->s_overhead_last = overhead;smp_wmb ();Signature · 1 line
1.9.3
Signature · 2 lines
Jan Kara <[email protected]> SUSE Labs, CR