From: David Chinner <dgc@sgi.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: David Chinner <dgc@sgi.com>, xfs-dev <xfs-dev@sgi.com>,
xfs-oss <xfs@oss.sgi.com>, asg-qa <asg-qa@melbourne.sgi.com>
Subject: Re: Review: fix test 004 to account for reserved space
Date: Tue, 19 Jun 2007 09:54:28 +1000 [thread overview]
Message-ID: <20070618235428.GD86004887@sgi.com> (raw)
In-Reply-To: <20070616195508.GB6929@infradead.org>
On Sat, Jun 16, 2007 at 08:55:08PM +0100, Christoph Hellwig wrote:
> On Mon, Jun 04, 2007 at 04:33:28PM +1000, David Chinner wrote:
> > With the changes to use some space by default in only in memory
> > as a reserved pool, df and statfs will now output a fre block
> > count that is slightly different to what is held in the superblock.
> >
> > Update the qa test to account for this change.
>
> I think we should rather subtract the amount of internally reserved blocks
> from the return value in xfs_statvfs.
Which return value?
With this patch:
---
fs/xfs/xfs_vfsops.c | 1 +
1 file changed, 1 insertion(+)
Index: 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c
===================================================================
--- 2.6.x-xfs-new.orig/fs/xfs/xfs_vfsops.c 2007-06-08 21:46:29.000000000 +1000
+++ 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c 2007-06-12 13:08:49.933837815 +1000
@@ -876,6 +876,7 @@ xfs_statvfs(
statp->f_blocks = sbp->sb_dblocks - lsize;
statp->f_bfree = statp->f_bavail =
sbp->sb_fdblocks - XFS_ALLOC_SET_ASIDE(mp);
+ statp->f_bfree += mp->m_resblks_avail;
fakeinos = statp->f_bfree << sbp->sb_inopblog;
#if XFS_BIG_INUMS
fakeinos += mp->m_inoadd;
An strace of df --block-size=4k gives:
statfs("/mnt/test", {f_type=0x58465342, f_bsize=4096, f_blocks=1048616, f_bfree=874158, f_bavail=873134, f_files=4204672, f_ffree=4191008, f_fsid={2072, 0}, f_namelen=255, f_frsize=4096}) = 0
write(1, "/dev/sdb8 1048616 "..., 66/dev/sdb8 1048616 174458 873134 17% /mnt/test
) = 66
statfs("/mnt/scratch", {f_type=0x58465342, f_bsize=4096, f_blocks=1248496, f_bfree=1248392, f_bavail=1247368, f_files=5004224, f_ffree=5004220, f_fsid={2073, 0}, f_namelen=255, f_frsize=4096}) = 0
write(1, "/dev/sdb9 1248496 "..., 69/dev/sdb9 1248496 104 1247368 1% /mnt/scratch
Is this what you were thinking of?
Note that this still requires the fix to the qa test because
the value in the on disk superblock matches f_bfree, not f_bavail
and df appears to output f_bavail....
Cheers,
Dave.
--
Dave Chinner
Principal Engineer
SGI Australian Software Group
prev parent reply other threads:[~2007-06-18 23:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-04 6:33 Review: fix test 004 to account for reserved space David Chinner
2007-06-15 6:23 ` David Chinner
2007-06-15 7:33 ` Timothy Shimmin
2007-06-16 4:10 ` Tim Shimmin
2007-06-16 19:55 ` Christoph Hellwig
2007-06-18 23:54 ` David Chinner [this message]
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=20070618235428.GD86004887@sgi.com \
--to=dgc@sgi.com \
--cc=asg-qa@melbourne.sgi.com \
--cc=hch@infradead.org \
--cc=xfs-dev@sgi.com \
--cc=xfs@oss.sgi.com \
/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