[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090327170208.GA27646@srcf.ucam.org>
Date: Fri, 27 Mar 2009 17:02:08 +0000
From: Matthew Garrett <mjg59@...f.ucam.org>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: Theodore Tso <tytso@....edu>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
David Rees <drees76@...il.com>, Jesper Krogh <jesper@...gh.cc>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Linux 2.6.29
On Fri, Mar 27, 2009 at 04:51:50PM +0000, Alan Cox wrote:
> On Fri, 27 Mar 2009 16:28:41 +0000
> Matthew Garrett <mjg59@...f.ucam.org> wrote:
> > The context was situations like errors on close() not occuring unless
> > you've fsync()ed first. I don't think that error case is sufficiently
> > common to warrant the cost of an fsync() on every single close,
> > especially since doing so would cripple any application that ever tried
> > to run on ext3.
>
> The fsync if you need to see all errors on close case has been true since
> before V7 unix. Its the normal default behaviour on these systems so
> anyone who assumes otherwise is just broken. There is a limit to the
> extent the OS can clean up after completely broken user apps.
If user applications should always check errors, and if errors can't be
reliably produced unless you fsync() before close(), then the correct
behaviour for the kernel is to always flush buffers to disk before
returning from close(). The reason we don't is that it would be an
unacceptable performance hit to take in return for an uncommon case - in
exactly the same way as always calling fsync() before close() is an
unacceptable performance hit to take in return for an uncommon case.
> IMHO the real solution to a lot of this actually got proposed earlier in
> the thread. Adding "fbarrier()" allows the expression of ordering without
> blocking and provides something new apps can use to get best performance.
If every application that does a clobbering rename has to call
fbarrier() first, then the kernel should just guarantee to do so on the
application's behalf. ext3, ext4 and btrfs all effectively do this, so
we should just make it explicit that Linux filesystems are expected to
behave this way. If people want to make their code Linux specific then
that's their problem, not the kernel's.
--
Matthew Garrett | mjg59@...f.ucam.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists