bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#294206: stat(1) unclear about block size


From: Jeroen van Wolffelaar
Subject: Re: Bug#294206: stat(1) unclear about block size
Date: Tue, 8 Feb 2005 23:37:54 +0100
User-agent: Mutt/1.3.28i

On Tue, Feb 08, 2005 at 05:19:37PM -0500, Michael Stone wrote:
> On Tue, Feb 08, 2005 at 01:56:00PM -0800, Paul Eggert wrote:
> >OK, thanks, I installed this (revised) patch into coreutils, which I
> >hope addresses that problem.
> 
> No, if you're going to use the statvfs block size you need to pull the
> other numbers from statvfs also. IOW, just add another flag (-F?) to use
> statvfs instead of statfs. I don't know of any assurance that they the
> two sets of numbers will be the same. (And since this entire thread is
> about the possibility that something might be ambiguous on some
> implementation somewhere, it doesn't make sense to make an assumption.)

Eh, current stat(1) code already uses statvfs if available, so IMHO it
would make no sense to add another flag for this, not to mention it'd be
a bit weird to propagate library weirdness to a user-level interface
like /usr/bin/stat is. If there are differences, they are in current
stat already, and they should be fixed one way or the other IMHO.

I like the (latest) patch from Paul Eggert more, although I'm not sure
people will be going to understand the term "fundamental block size"
immediately. Maybe "Unit Block Size (%S)" vs. "Optimal-I/O blocksize
(%s)"? Also, I think it's a bit betrayal to the user to just copy
f_bsize if f_frsize is unavailable, as who knows that actually that is
the correct fundamental blocksize? If it is, then this whole %S vs %s
thing isn't needed anyway, the whole point of %S is to have a definite
answer to "How many bytes is a block as used in the free block count?".
If you're going to offer %S to retrieve fundamental blocksize, I think
it'd be best to actually really retrieve that value, and do something
smart otherwise (error out, noting in the documentation that %S might
not always be available?), unless of course it is for a given system
actually known that f_bsize is indeed the unit size for free/total
blocks.

By the way, I didn't yet test the patch, it'd be relatively much work
for me, but I'm willing to do so if really nobody else seems able to
test this.

Thank you all,
--Jeroen

-- 
Jeroen van Wolffelaar
address@hidden (also for Jabber & MSN; ICQ: 33944357)
http://Jeroen.A-Eskwadraat.nl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]