lkml.org 
[lkml]   [2009]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 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@srcf.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@srcf.ucam.org


\
 
 \ /
  Last update: 2009-03-27 18:05    [W:0.280 / U:1.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site