Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jan 2002 16:18:12 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Max Khon <fjoe@iclub.nsu.ru>
Cc:        Cy Schubert - ITSD Open Systems Group <Cy.Schubert@uumail.gov.bc.ca>, Poul-Henning Kamp <phk@critter.freebsd.dk>, <arch@FreeBSD.ORG>
Subject:   Re: request for review
Message-ID:  <20020116155828.T487-100000@gamplex.bde.org>
In-Reply-To: <20020116000607.B10938@iclub.nsu.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020116155828.T487-100000>