NFS client/buffer cache deadlock

Brian Fundakowski Feldman green at freebsd.org
Tue Apr 26 07:07:02 PDT 2005


On Wed, Apr 20, 2005 at 07:38:59PM +0200, Marc Olzheim wrote:
> On Wed, Apr 20, 2005 at 01:16:05PM -0400, Garrett Wollman wrote:
> > <<On Wed, 20 Apr 2005 16:38:42 +0200, Marc Olzheim <marcolz at stack.nl> said:
> > 
> > > Btw.: I'm not sure write(),writev() and pwrite() are allowed to do short
> > > writes on regular files... ?
> > 
> > I believe it is the intent of the Standard to prohibit this (a
> > paragraph in the rationale says that short writes can only happen if
> > O_NONBLOCK is set, but this is clearly wrong because the normative
> > text says end-of-medium also results in a short write) but there does
> > not appear to be any language which requires atomic behavior for
> > descriptors other than pipes and FIFOs.
> > 
> > As a quality-of-implementation matter, for writes to regular files not
> > to be atomic would be considered surprising.
> > 
> > -GAWollman
> 
> Could someone from standards comment here ? I believe Garrett is
> right...
> (thread is on -hackers and -current)

What prevents you from using O_FSYNC | O_APPEND to get the
functionality you desire?  The semantics of IO_UNIT -- atomic writes
-- are definitely defined and assumed to function properly by the rest
of the kernel.  Allowing asynchronous unbounded atomic appends is
impossible, so something must be done to prevent deadlock.  Breaking
IO_UNIT really shouldn't be considered as a solution.  Automatically
turning the write into a synchronous + atomic append if an asynchrous
+ atomic append is not possible might follow POLA best.

-- 
Brian Fundakowski Feldman                           \'[ FreeBSD ]''''''''''\
  <> green at FreeBSD.org                               \  The Power to Serve! \
 Opinions expressed are my own.                       \,,,,,,,,,,,,,,,,,,,,,,\


More information about the freebsd-standards mailing list