Date: Tue, 26 Apr 2005 10:07:01 -0400 From: Brian Fundakowski Feldman <green@freebsd.org> To: Marc Olzheim <marcolz@stack.nl> Cc: freebsd-standards@freebsd.org Subject: Re: NFS client/buffer cache deadlock Message-ID: <20050426140701.GB5789@green.homeunix.org> In-Reply-To: <20050420173859.GA99695@stack.nl> References: <20050419151800.GE1157@green.homeunix.org> <20050419160258.GA12287@stack.nl> <20050419160900.GB12287@stack.nl> <20050419161616.GF1157@green.homeunix.org> <20050419204723.GG1157@green.homeunix.org> <20050420140409.GA77731@stack.nl> <20050420142448.GH1157@green.homeunix.org> <20050420143842.GB77731@stack.nl> <16998.36437.809896.936800@khavrinen.csail.mit.edu> <20050420173859.GA99695@stack.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
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@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@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050426140701.GB5789>