Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 May 2001 03:50:08 -0700 (PDT)
From:      Jan Conrad <conrad@th.physik.uni-bonn.de>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/27232: On NFSv3 mounted filesystems, stat returns st_blksize=512
Message-ID:  <200105101050.f4AAo8t67695@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/27232; it has been noted by GNATS.

From: Jan Conrad <conrad@th.physik.uni-bonn.de>
To: Bruce Evans <bde@zeta.org.au>
Cc: <freebsd-gnats-submit@FreeBSD.ORG>,
	<wollman@khavrinen.lcs.mit.edu>
Subject: Re: kern/27232: On NFSv3 mounted filesystems, stat returns st_blksize=512
Date: Thu, 10 May 2001 12:46:40 +0200 (CEST)

 On Thu, 10 May 2001, Bruce Evans wrote:
 
 > From: Bruce Evans <bde@zeta.org.au>
 > To: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
 > Cc: freebsd-gnats-submit@FreeBSD.ORG
 > Subject: Re: kern/27232: On NFSv3 mounted filesystems, stat returns st_blksize=512
 > Date: Thu, 10 May 2001 18:24:04 +1000 (EST)
 >
 >  On Wed, 9 May 2001, Garrett Wollman wrote:
 >
 >  >  <<On Wed, 9 May 2001 10:11:55 -0700 (PDT), conrad@th.physik.uni-bonn.de said:
 >  >
 >  >  > On NFSv3 mounts, stat returns st_blksize=512 for every regular file.
 >  >  > This in turn is used by libc routines as a default buffer size, as it
 >  >  > should be the 'optimal' io blocksize.
 >  >
 >  >  No.  It should be the block size used by the underlying filesystem's
 >  >  block allocator,
 >
 >  Correct.  Even if there is no underlying filesystem's block allocator,
 >  stat() must fake it, and should fake it as well as possible.  nfs seems
 >  to have regressed to always setting vap->va_blocksize to NFS_FABLKSIZE
 >  (512) in the v3 case (see nfs_subs.c).
 
 
 My question is: Why not set this to mnt_stat.f_iosize of the mount point?
 (As ufs does it?)
 
 >
 >  >  and in which the file's `st_blocks' size-on-disk is
 >  >  reportedi.
 >
 >  No.  At least under FreeBSD, st_blocks is in units of blocks with size
 >  S_BLKSIZE (512).  It may count blocks for metadata, so it may be larger
 >  than the file size.
 >
 >  >  While SUS describes it as a ``preferred'' block size, and
 >  >  the FreeBSD manual pages describe it as ``optimal ... for I/O'', the
 >
 >  It is just the best available approximation to the optimal i/o size.
 >  If it is good enough for filesystem blocks, then it can't be very bad
 >  for userland i/o.
 
 It is *very* bad for userland io. Unfortunately we have only very limited
 space here so some poor guys have to sit next to our file server!
 
 They can tell by the sound when somebody is saving a large file by stdio
 fwrites!!!
 
 It takes *MORE* then ten times than with a larger st_blksize!
 
 
 -Jan
 
 
 >
 >  >  most important meaning of this field is as a multiplier of st_blocks
 >  >  to determine the file's size.
 >
 >  No.  The multiplier is 512.
 >
 >  Bruce
 >
 >
 > To Unsubscribe: send mail to majordomo@FreeBSD.org
 > with "unsubscribe freebsd-bugs" in the body of the message
 >
 
 -- 
 Physikalisches Institut der Universitaet Bonn
 Nussallee 12
 D-53115 Bonn
 GERMANY
 
 
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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