From: Eric Sandeen <sandeen@redhat.com>
To: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH] ext4: fix overhead calculations in ext4_statfs, again
Date: Thu, 25 Oct 2012 12:14:23 -0500 [thread overview]
Message-ID: <5089736F.1030509@redhat.com> (raw)
In-Reply-To: <50896FD6.1010807@redhat.com>
sorry that should be "ext4_statfs" in the subject.
On 10/25/12 11:59 AM, Eric Sandeen wrote:
> "overhead" was a write-only variable in this function after commit
> 952fc18e; we set it to 0 for minixdf, or to sbi->s_overhead if !minixdf,
> but never read it again after that.
>
> We need to use it, not sbi->s_overhead, when subtracting out overhead
> for f_blocks, or we get the wrong answer for minixdf.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>
> "Once more, with feeling!" ;)
>
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index e44b233..2feaf78 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -4758,7 +4758,7 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf)
>
> buf->f_type = EXT4_SUPER_MAGIC;
> buf->f_bsize = sb->s_blocksize;
> - buf->f_blocks = ext4_blocks_count(es) - EXT4_C2B(sbi, sbi->s_overhead);
> + buf->f_blocks = ext4_blocks_count(es) - EXT4_C2B(sbi, overhead);
> bfree = percpu_counter_sum_positive(&sbi->s_freeclusters_counter) -
> percpu_counter_sum_positive(&sbi->s_dirtyclusters_counter);
> /* prevent underflow in case that few free space is available */
>
> --
> 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:[~2012-10-25 17:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 16:59 [PATCH] ext4: fix overhead calculations in ext4_stats, again Eric Sandeen
2012-10-25 17:14 ` Eric Sandeen [this message]
2012-10-29 17:13 ` Jan Kara
2012-11-08 15:34 ` Theodore Ts'o
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=5089736F.1030509@redhat.com \
--to=sandeen@redhat.com \
--cc=linux-ext4@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).