From owner-freebsd-arch Tue Jan 15 21:30: 3 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 99C1337B417 for ; Tue, 15 Jan 2002 21:29:53 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id QAA13871; Wed, 16 Jan 2002 16:17:02 +1100 Date: Wed, 16 Jan 2002 16:18:12 +1100 (EST) From: Bruce Evans X-X-Sender: To: Max Khon Cc: Cy Schubert - ITSD Open Systems Group , Poul-Henning Kamp , Subject: Re: request for review In-Reply-To: <20020116000607.B10938@iclub.nsu.ru> Message-ID: <20020116155828.T487-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 16 Jan 2002, Max Khon wrote: > On Wed, Jan 16, 2002 at 04:15:43AM +1100, Bruce Evans wrote: > > > This patch also makes FreeBSD almost compatible with FreeBSD (versions > > 1, 2, 3) that is. Old versions vn_stat() simply passed back the > > va_blocksize set by VOP_GETTATTR(). > > NetBSD/OpenBSD do exactly the same The main point of the differences in FreeBSD is to set st_blksize to a reasonable value for disks (since individual filesystems didn't do it). The changes really shouldn't have affected non-disks. > > > > I think it is bogus for devices other than disks to flout a > > > > va_blocksize, but I am on the other hand not sure what the > > > > relevant (if any) standards say. > > > > POSIX says almost the same as the quote from www.opengroup.org in the > > sources: "A file system-specific [sic] preferred I/O block size for > > this object". 0 is wrong except possibly for /dev/null since it is > > a very bad I/O size. > > do you think we should remove setting sb->st_blksize to 0 in vn_stat() at all? Yes. We should also fix any filesystems that set va_blocksize to 0, or convert a va_blocksize of 0 to a more sensible st_blksize. I just noticed the following comment in vn_stat(): * Default to zero to catch bogus uses of this field. This causes many bogus block sizes in the same way that a fixed default in the kernel does. An st_blksize of 0 means stdio's BUFSIZ in many cases, since stdio prefers to use st_blksize but has to invent a block size if st_blksize is not useful. BUFSIZ is 1024, which is rather small these days. It's good for slow cdevs but not much else. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message