From owner-freebsd-current@FreeBSD.ORG Sat Nov 15 17:55:05 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 7D8BE16A4CE for ; Sat, 15 Nov 2003 17:55:05 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE12143F75 for ; Sat, 15 Nov 2003 17:55:03 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id MAA15943; Sun, 16 Nov 2003 12:54:58 +1100 Date: Sun, 16 Nov 2003 12:54:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: peter.edwards@openet-telecom.com In-Reply-To: <3FB4BA0300000058@mail.openet-telecom.com> Message-ID: <20031116124255.O3037@gamplex.bde.org> References: <3FB4BA0300000058@mail.openet-telecom.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: Sun, 16 Nov 2003 01:55:05 -0000 On Fri, 14 Nov 2003 peter.edwards@openet-telecom.com wrote: > >> Bruce Evans wrote: > >> > ... > >> > I just got around to testing the patch in that reply: > >> > ... > >> > >> 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? > > > >Possibly not, but the protocol is broken if it actually requires that. > > What makes you say that? I would think the utility of negative counts > for disk sizes and available spaces is marginal. Solaris, POSIX, and > NFS seem to get on fine without it. What am I (and they) missing? Well, the f_bavail field (not to mention all the other fields (until recently, sigh)) has always been signed and does go negative in BSD's statfs, so the protocol is broken if it can't support negative values in it. > >The type pun to negative values is in most versions of BSD: > > [snip code snippets and bug] > > That's great for interacting with other BSDs, but it still abusing > the protocol. As filesystems with approaching 2^64 bytes become possible > it probably has more of an impact. 2^63 won't be needed any time soon. This problem was more serious with nfsv2 when file systems reached 2^31 bytes not so long ago. The current problem is actually more with non-BSD clients and a BSD server. The BSD server will send the negative values and the non-BSD client may convert them to huge positive ones. Non-BSD servers presumably won't send negative values. Bruce