From: Al Viro <viro@ZenIV.linux.org.uk>
To: Michal Simek <michal.simek@petalogix.com>
Cc: Nate Straz <nate-ltp@refried.org>,
subrata@linux.vnet.ibm.com, ltp-list@lists.sourceforge.net,
John Williams <john.williams@petalogix.com>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
linux-fsdevel@vger.kernel.org
Subject: Re: [LTP] statvfs -> f_bavail
Date: Tue, 21 Apr 2009 01:25:03 +0100 [thread overview]
Message-ID: <20090421002503.GA8633@ZenIV.linux.org.uk> (raw)
In-Reply-To: <49EC1945.1000805@petalogix.com>
On Mon, Apr 20, 2009 at 08:42:13AM +0200, Michal Simek wrote:
> That mean that for all other fs is possible to set nr_blocks=0 (f_bavail=0) and for all this cases
> fsync02 test failed. That mean that make sense to test f_bavail value in LTP and if is zero
> don't work with it. Am I right?
Huh?
a) ramfs has no such thing as "amount of available space", simply
because it has no limit on total size occupied.
b) tmpfs *does* have a limit and will report f_bavail, unless you
tell it not to limit (that's what nr_blocks=... is; it sets the fs size limit
for tmpfs and 0 means "no limit, act as ramfs").
c) nfs client has no fscking clue how much space is left on server
for non-root; moreover, in case of nfs root on client might very well be
mapped to something else on server.
d) something local on-disk (ext2, ext3, etc., etc.) can and will fill
->f_bavail with non-zero data
e) procfs has nothing to put there, period. You can't create
files there, it doesn't have anything like fixed-sized something that might
be partially empty.
The bottom line: some filesystems have reasonable answer to "how much space
is left on that fs for non-root user". Those fill the field in question.
And for some filesystems the question makes no sense whatsoever.
So statfs(2) has every right to leave the damn thing zero. Whether it
will do that or not depends on the fs type. Userland code must be able
to cope with that, unless it *knows* which filesystem type will it be
dealing with.
Incidentally, nr_blocks=... will be cheerfully shat upon by just about every
fs out there. It's tmpfs-specific.
next prev parent reply other threads:[~2009-04-21 0:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <49E759FB.70103@petalogix.com>
[not found] ` <49E847FB.1030801@petalogix.com>
[not found] ` <20090417173107.GA3590@refried.org>
2009-04-20 6:16 ` [LTP] statvfs -> f_bavail Michal Simek
2009-04-20 6:26 ` Al Viro
2009-04-20 6:42 ` Michal Simek
[not found] ` <49EC1945.1000805-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org>
2009-04-20 22:59 ` Nate Straz
2009-04-21 0:25 ` Al Viro [this message]
2009-04-21 0:38 ` [LTP] " Andreas Dilger
2009-04-21 0:47 ` Al Viro
2009-04-21 8:45 ` Michal Simek
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=20090421002503.GA8633@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=john.williams@petalogix.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ltp-list@lists.sourceforge.net \
--cc=michal.simek@petalogix.com \
--cc=nate-ltp@refried.org \
--cc=subrata@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).