delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/03/08/08:37:40

X-Spam-Check-By: sourceware.org
Date: Wed, 8 Mar 2006 14:37:29 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: partition size incorrectly reported
Message-ID: <20060308133729.GT3184@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <1ACB95D81B24969895E72CC1 AT red-2> <20060308125503 DOT GR3184 AT calimero DOT vinschen DOT de> <440ED903 DOT 7000605 AT byu DOT net> <20060308132346 DOT GS3184 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
In-Reply-To: <20060308132346.GS3184@calimero.vinschen.de>
User-Agent: Mutt/1.4.2i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mar  8 14:23, Corinna Vinschen wrote:
> On Mar  8 06:15, Eric Blake wrote:
> > According to Corinna Vinschen on 3/8/2006 5:55 AM:
> > > Cygwin can nothing do about that.  Maybe df can by taking quotas into
> > > account.  Eric?
> > 
> > Not really.  SUSv3/POSIX specify df without allowing it to take quotas
> > into account - so it is really space available on the file system, not
> > space available to the current user within the file system.  However, you
> > may want to propose a GNU extension that adds a new option to df which
> > takes quotas into account; if so, raise the question on the
> > bug-coreutils<AT>gnu<DOT>org mailing list.  But remember that reading disk
> > quotas isn't very portable, so it may be a difficult task to actually
> > provide a worthwhile patch along those lines.
> 
> 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?

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.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019