From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Chin-Tsung Cheng <chintzung@gmail.com>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext4: include journal blocks of internal journal in df overhead calcs
Date: Wed, 13 Aug 2014 15:55:43 -0700 [thread overview]
Message-ID: <20140813225543.GK2808@birch.djwong.org> (raw)
In-Reply-To: <1407937043-23186-1-git-send-email-chintzung@gmail.com>
On Wed, Aug 13, 2014 at 09:37:23PM +0800, Chin-Tsung Cheng wrote:
> The journal blocks of external journal device should not
> be counted as overhead.
>
> Signed-off-by: Chin-Tsung Cheng <chintzung@gmail.com>
> ---
> fs/ext4/super.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 32b43ad..03b2f62 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -3316,9 +3316,10 @@ int ext4_calculate_overhead(struct super_block *sb)
> memset(buf, 0, PAGE_SIZE);
> cond_resched();
> }
> - /* Add the journal blocks as well */
> - if (sbi->s_journal)
> - overhead += EXT4_NUM_B2C(sbi, sbi->s_journal->j_maxlen);
> + /* Add the internal journal blocks as well */
> + if ((sbi->s_journal) &&
> + (sbi->s_journal->j_fs_dev == sbi->s_journal->j_dev))
> + overhead += EXT4_NUM_B2C(sbi, sbi->s_journal->j_maxlen);
I think you have some whitespace issues here, but otherwise this seems ok.
External journals aren't counted towards the total blocks count, correct?
--D
>
> sbi->s_overhead = overhead;
> smp_wmb();
> --
> 1.9.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-08-13 22:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-13 13:37 Chin-Tsung Cheng
2014-08-13 22:55 ` Darrick J. Wong [this message]
2014-08-14 3:21 ` Eric Sandeen
2014-08-14 6:56 ` Chin-Tzung Cheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140813225543.GK2808@birch.djwong.org \
--to=darrick.wong@oracle.com \
--cc=adilger.kernel@dilger.ca \
--cc=chintzung@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®