ext3: Count internal journal as bsddf overhead in ext3_statfs
authorChin-Tsung Cheng <chintzung@gmail.com>
Fri, 15 Aug 2014 07:49:31 +0000 (15:49 +0800)
committerJan Kara <jack@suse.cz>
Tue, 19 Aug 2014 21:16:51 +0000 (23:16 +0200)
The journal blocks of external journal device should not
be counted as overhead.

Signed-off-by: Chin-Tsung Cheng <chintzung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext3/super.c

index 08cdfe5..622e882 100644 (file)
@@ -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();