From owner-freebsd-questions@FreeBSD.ORG Thu Feb 5 08:11:49 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 628E21065672 for ; Thu, 5 Feb 2009 08:11:49 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id 3B5988FC08 for ; Thu, 5 Feb 2009 08:11:49 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id n158BgGn088125 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 5 Feb 2009 00:11:42 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id n158BgjH088124; Thu, 5 Feb 2009 00:11:42 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA17740; Thu, 5 Feb 09 00:10:40 PST Date: Thu, 05 Feb 2009 00:11:59 -0800 From: perryh@pluto.rain.com To: dnelson@allantgroup.com Message-Id: <498a9f4f.MMsTyUVGLtZWmJhj%perryh@pluto.rain.com> References: <158E6ABD-6BCF-4222-AD59-9B43FE6832D5@zog.net> <20090203215326.GN75802@dan.emsphone.com> <49894cf9.J2VbLPqLSoDq7yay%perryh@pluto.rain.com> <20090204151450.GQ75802@dan.emsphone.com> In-Reply-To: <20090204151450.GQ75802@dan.emsphone.com> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: john@zog.net, freebsd-questions@freebsd.org Subject: Re: NFSv2 Wrong FS Size X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Feb 2009 08:11:49 -0000 > > > you could rebuild "df" to print its numbers as unsigned > > > instead of signed. Just watch out if your local filesystems > > > start eating into their 8% reserve, since they'll start > > > reporting huge values. > > > > Or patch "df" to print local filesystem sizes as signed -- so > > that the reserve reporting still works -- and NFS as unsigned > > to match the spec. > > That works as long as you don't NFS-mount other FreeBSD systems > with overfull drives :) Looking at this a little more closely, it appears that the "struct statfs" returned by statfs(2) and friends tells the whole story, using 64-bit values most of which are defined as unsigned. (Only f_bavail and f_ffree -- the number of blocks and inodes available to non-superusers -- are defined as signed.) The code that converts from the 32-bit NFSv2 to the 64-bit "struct statfs" values seems more likely to be somewhere in NFS than in df(1).