From owner-freebsd-current@FreeBSD.ORG Fri Nov 14 12:10:11 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0266016A4CE for ; Fri, 14 Nov 2003 12:10:11 -0800 (PST) Received: from sweeper.openet-telecom.com (mail.openet-telecom.com [62.17.151.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3034844029 for ; Fri, 14 Nov 2003 12:10:09 -0800 (PST) (envelope-from peter.edwards@openet-telecom.com) Received: from mail.openet-telecom.com (unverified) by sweeper.openet-telecom.com ; Fri, 14 Nov 2003 20:11:00 +0000 Received: from openet-telecom.com (10.0.0.40) by mail.openet-telecom.com (NPlex 6.5.027) (authenticated as peter.edwards@openet-telecom.com) id 3FB4BA0400000A68; Fri, 14 Nov 2003 20:05:20 +0000 Message-ID: <3FB536A0.4020505@openet-telecom.com> Date: Fri, 14 Nov 2003 20:10:08 +0000 From: Peter Edwards User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5) Gecko/20031104 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce Evans References: <20031113020400.GA44619@xor.obsecurity.org> <20031113074425.GC39616@cirb503493.alcatel.com.au> <20031113085418.GA47995@xor.obsecurity.org> <20031113131057.GD22887@cicely12.cicely.de> <3FB4E8A1.6090402@openet-telecom.com> <20031115054126.B9400@gamplex.bde.org> In-Reply-To: <20031115054126.B9400@gamplex.bde.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Peter Jeremy cc: Kris Kennaway cc: ticso@cicely.de cc: current@freebsd.org Subject: Re: Who needs these silly statfs changes... X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2003 20:10:11 -0000 Bruce Evans wrote: > On Fri, 14 Nov 2003, Peter Edwards wrote: > >> Bernd Walter wrote: >> >>> On Thu, Nov 13, 2003 at 12:54:18AM -0800, Kris Kennaway wrote: >>> >>> >>>> On Thu, Nov 13, 2003 at 06:44:25PM +1100, Peter Jeremy wrote: >>>> >>>> >>>>> On Wed, Nov 12, 2003 at 06:04:00PM -0800, Kris Kennaway wrote: >>>>> >>>>> >>>>>> ...my sparc machine reports that my i386 nfs server has 15 >>>>>> exabytes of >>>>>> free space! >>>>>> >>>>>> enigma# df -k >>>>>> Filesystem 1K-blocks Used Avail Capacity Mounted on >>>>>> rot13:/mnt2 56595176 54032286 18014398507517260 0% /rot13/mnt2 >>>>>> >>>>>> >>>>> 18014398507517260 = 2^54 - 1964724. and 2^54KB == 2^64 bytes. Is it >>>>> possible that rot13:/mnt2 has negative free space? (ie it's into the >>>>> 8-10% reserved area). >>>>> >>>>> >>>> Yes, that's precisely what it is..the bug is either in df or the >>>> kernel (I suspect the latter, i.e. something in the nfs code). >>>> >>>> >>> And it's nothing new - I'm seeing this since several years now. >>> >>> >> The NFS protocols have unsigned fields where statfs has signed >> equivalents: NFS can't represent negative available disk space ( Without >> the knowledge of the underlying filesystem on the server, negative free >> space is a little nonsensical anyway, I suppose) >> >> The attached patch stops the NFS server assigning negative values to >> unsigned fields in the statfs response, and works against my local >> solaris box. Seem reasonable? > > > The client attampts to fix this by pretending that the unsigned fields > are signed. -current tries to do more to support file system sizes larger > that 1TB, but the code for this is not even wrong except it may be wrong > enough to break the negative values. See my reply to one of the PRs > for more details. > > I just got around to testing the patch in that reply: > > %%% > Index: nfs_vfsops.c > =================================================================== > RCS file: /home/ncvs/src/sys/nfsclient/nfs_vfsops.c,v Your patch to nfs_vfsops won't apply to my Solaris kernel :-) The protocol says "abytes" is unsigned, so the server shouldn't be lying by sending a huge positive value for available space on a full filesystem. No?