Skip to contentSkip to conversation

ext3: Count internal journal as bsddf overhead in ext3_statfs

PATCH In review Chin-Tsung Cheng 2 participants 2 messages Aug 15, 2014 – Aug 19, 2014

lore
Share & tools
lore
#0 lore raw

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.

---
 fs/ext3/super.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/ext3/super.c +3 -2
index 08cdfe5..622e882 100644
@@ -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
#1 lore raw
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
---
 fs/ext3/super.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
fs/ext3/super.c +3 -2
index 08cdfe5..622e882 100644
@@ -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