This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: partition size incorrectly reported


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Corinna Vinschen on 3/8/2006 6:37 AM:
>> Maybe Cygwin can do something about that by never returning more
>> available than total blocks.  Would that be helpful/desirable/correct,
>> or sahould we just keep it as it is now?

I'm still thinking about the best approach here.  Also, right now it seems
that coreutils is preferring statfs over statvfs, even though statvfs is
the standardized interface (it is a known issue recently raised on the
upstream mailing list).

> 
> Hang on... I'm just looking into the output of statvfs on a drive which
> has a 1Meg quota for the current user in place.  The values in the
> statvfs structure correspond to the return values of GetDiskFreeSpaceEx
> like this:
> 
>   f_blocks == TotalNumberOfBytes     (corresponds to quota)
>   f_bfree  == TotalNumberOfFreeBytes (does NOT correspond to quota)
>   f_bavail == FreeBytesAvailable     (corresponds to quota)
> 
> The values returned for the quota challanged drive:
> 
> f_bsize  : 4096
> f_blocks : 256		(256 * f_bsize) == 1 Meg
> f_bfree  : 1339399	(real free blocks of the drive)
> f_bavail : 0		(blocks free for user under quota lore)
> 
> Per standard, f_bavail shows the number of free blocks available to
> non-superuser.  However, df seems to use the f_bfree value, which is,
> per standard, the number of total blocks free on the drive.  I'm
> wondering if df shouldn't rather use f_bavail and f_blocks instead of
> f_bfree and f_blocks?!?
> 
> What Cygwin could do is to write the FreeBytesAvailable value also into
> f_bfree, but I'm wincing at this idea since it would (unnecessarily?)
> reduce the information available in the structure.  I'm not actually
> convinced this would be a good idea.

Is it worth adding additional fields to struct statvfs to avoid loss of
information (of course, then those fields are not portable, because they
are not standardized)?  What does Linux do in the presence of user quotas?

- --
Life is short - so eat dessert first!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEDuJF84KuGfSFAYARAtcoAKCV6+2i/6fj3a/TgIGPO2DzOM3VzwCgnrZQ
12N1RlGezfUMnBCdpes+3xE=
=dSCP
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]