linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Patrick J. LoPresti" <patl@curl.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [ANNOUNCE] Ext3 vs Reiserfs benchmarks
Date: 15 Jul 2002 15:13:24 -0400	[thread overview]
Message-ID: <s5gsn2kst2j.fsf@egghead.curl.com> (raw)
In-Reply-To: <mit.lcs.mail.linux-kernel/20020715173337$acad@traf.lcs.mit.edu>

Chris Mason <mason@suse.com> writes:

> > One other thing.  I think this statement is misleading:
> > 
> >     IF your server is stable and not prone to crashing, and/or you
> >     have the write cache on your hard drives battery backed, you
> >     should strongly consider using the writeback journaling mode of
> >     Ext3 versus ordered.
> > 
> > This makes it sound like data=writeback is somehow unsafe when
> > machines crash.  I do not think this is true.  If your application
> > (e.g., Postfix) is written correctly (which it is), so it calls
> > fsync() when it is supposed to, then data=writeback is *exactly* as
> > safe as any other journalling mode.  
> 
> Almost.  data=writeback makes it possible for the old contents of a
> block to end up in a newly grown file.

Only if the application is already broken.

> There are a few ways this can screw you up:
> 
> 1) that newly grown file is someone's inbox, and the old contents of the
> new block include someone else's private message.
>
> 2) That newly grown file is a control file for the application, and the
> application expects it to contain valid data within (think sendmail).  

In a correctly-written application, neither of these things can
happen.  (See my earlier message today on fsync() and MTAs.)  To get a
file onto disk reliably, the application must 1) flush the data, and
then 2) flush a "validity" indicator.  This could be a sequence like:

  create temp file
  flush data to temp file
  rename temp file
  flush rename operation

In this sequence, the file's existence under a particular name is the
indicator of its validity.

If you skip either of these flush operations, you are not behaving
reliably.  Skipping the first flush means the validity indicator might
hit the disk before the data; so after a crash, you might see invalid
data in an allegedly valid file.  Skipping the second flush means you
do not know that the validity indicator has been set, so you cannot
report success to whoever is waiting for this "reliable write" to
happen.

It is possible to make an application which relies on data=ordered
semantics; for example, skipping the "flush data to temp file" step
above.  But such an application would be broken for every version of
Unix *except* Linux in data=ordered mode.  I would call that an
incorrect application.

> Nope, battery backed caches don't make data=writeback more or less safe
> (with respect to the data anyway).  They do make data=ordered and
> data=journal more safe.

A theorist would say that "more safe" is a sloppy concept.  Either an
operation is safe or it is not.  As I said in my last message,
data=ordered (and data=journal) can reduce the risk for poorly written
apps.  But they cannot eliminate that risk, and for a correctly
written app, data=writeback is 100% as safe.

 - Pat

  parent reply	other threads:[~2002-07-15 19:10 UTC|newest]

Thread overview: 138+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20020712162306$aa7d@traf.lcs.mit.edu>
     [not found] ` <mit.lcs.mail.linux-kernel/20020712162306$aa7d@traf.lcs.mit.edu>
2002-07-15 15:22   ` [ANNOUNCE] Ext3 vs Reiserfs benchmarks Patrick J. LoPresti
2002-07-15 17:31     ` Chris Mason
2002-07-15 18:33     ` Matthias Andree
     [not found]     ` <20020715173337$acad@traf.lcs.mit.edu>
     [not found]       ` <mit.lcs.mail.linux-kernel/20020715173337$acad@traf.lcs.mit.edu>
2002-07-15 19:13         ` Patrick J. LoPresti [this message]
2002-07-15 20:55           ` Matthias Andree
2002-07-15 21:23             ` Patrick J. LoPresti
2002-07-15 21:38               ` Thunder from the hill
2002-07-16 12:31                 ` Matthias Andree
2002-07-16 15:53                   ` Thunder from the hill
2002-07-16 19:26                     ` Matthias Andree
2002-07-16 19:38                       ` Thunder from the hill
2002-07-16 23:22                         ` close return value (was Re: [ANNOUNCE] Ext3 vs Reiserfs benchmarks) Zack Weinberg
2002-07-17  1:03                           ` Alan Cox
2002-07-16 23:52                             ` close return value David S. Miller
2002-07-17  1:35                               ` Alan Cox
2002-07-17  0:20                                 ` David S. Miller
2002-07-17  1:05                                   ` Linus Torvalds
2002-07-17  1:05                                     ` David S. Miller
2002-07-17  1:23                                       ` Linus Torvalds
2002-07-17 11:51                                         ` Matthias Andree
2002-07-17 17:23                                           ` Andries Brouwer
2002-07-20  8:00                                         ` Florian Weimer
2002-07-20 16:45                                           ` Linus Torvalds
2002-07-26  0:06                                             ` EFAULT vs. SIGSEGV [was Re: close return value] Pavel Machek
2002-07-26 14:01                                               ` (no subject) Alexis Deruelle
     [not found]                                   ` <mailman.1026868201.10433.linux-kernel2news@redhat.com>
2002-07-18  0:01                                     ` close return value Pete Zaitcev
2002-07-18  0:10                                       ` Thunder from the hill
     [not found]                                       ` <mit.lcs.mail.linux-kernel/200207180001.g6I015f02681@devserv.devel.redhat.com>
2002-07-18 14:42                                         ` Patrick J. LoPresti
2002-07-18 15:13                                           ` Richard B. Johnson
2002-07-18 15:32                                             ` Sandy Harris
2002-07-18 23:47                                           ` Albert D. Cahalan
2002-07-19 16:12                                             ` Patrick J. LoPresti
2002-07-19 16:24                                               ` Joseph Malicki
2002-07-19 18:48                                                 ` Patrick J. LoPresti
2002-07-19 19:25                                                   ` Lars Marowsky-Bree
2002-07-19 19:30                                                     ` Arnaldo Carvalho de Melo
2002-07-19 19:45                                                       ` Joseph Malicki
2002-07-19 19:55                                                         ` Arnaldo Carvalho de Melo
2002-07-20 18:25                                                         ` Bernd Eckenfels
2002-07-20 23:06                                                         ` Sandy Harris
2002-07-20 14:42                                                 ` Andries Brouwer
2002-07-18 20:09                                       ` Hildo.Biersma
2002-07-18 23:55                                         ` Pete Zaitcev
2002-07-19 11:31                                           ` Hildo.Biersma
2002-07-19 16:16                                             ` Pete Zaitcev
2002-07-23 22:19                                           ` Bill Davidsen
2002-07-17  0:10                             ` close return value (was Re: [ANNOUNCE] Ext3 vs Reiserfs benchmarks) Zack Weinberg
2002-07-17  1:45                               ` Alan Cox
2002-07-17 18:24                                 ` Zack Weinberg
2002-07-22 16:42                                 ` Rogier Wolff
2002-07-17  8:00                               ` Lars Marowsky-Bree
2002-07-17 15:49                                 ` Thunder from the hill
2002-07-17  2:22                             ` Elladan
2002-07-17  2:54                               ` Thunder from the hill
2002-07-17  3:00                                 ` Elladan
2002-07-17  3:10                                   ` Thunder from the hill
2002-07-17  3:31                                     ` Elladan
2002-07-17  4:17                               ` Stevie O
2002-07-17  4:38                                 ` Elladan
2002-07-17 14:39                                   ` Andreas Schwab
2002-07-17 16:49                                     ` Elladan
2002-07-17 17:43                                       ` Linus Torvalds
2002-07-17 22:07                                         ` Elladan
2002-07-18  9:48                                         ` Ketil Froyn
2002-07-17 17:17                                   ` Andries Brouwer
2002-07-17 17:51                                     ` Richard Gooch
2002-07-17  7:34                               ` close return value (was Re: [ANNOUNCE] Ext3 vs Reiserfs benchmarks Kai Henningsen
2002-07-15 21:59               ` Ketil Froyn
2002-07-15 23:08                 ` Matti Aarnio
2002-07-16 12:33                   ` Matthias Andree
2002-07-15 22:55             ` Alan Cox
2002-07-15 21:58               ` Matthias Andree
2002-07-15 21:14           ` Chris Mason
2002-07-15 21:31             ` Patrick J. LoPresti
2002-07-15 22:12               ` Richard A Nelson
2002-07-16  1:02               ` Lawrence Greenfield
     [not found]                 ` <mit.lcs.mail.linux-kernel/200207160102.g6G12BiH022986@lin2.andrew.cmu.edu>
2002-07-16  1:43                   ` Patrick J. LoPresti
2002-07-16  1:56                     ` Thunder from the hill
2002-07-16 12:47                     ` Matthias Andree
2002-07-16 21:09                     ` James Antill
2002-07-16 12:35             ` Matthias Andree
2002-07-16  7:07     ` Dax Kelson
2002-07-12 16:21 Dax Kelson
2002-07-12 17:05 ` Andreas Dilger
2002-07-12 17:26   ` kwijibo
2002-07-12 17:36     ` Andreas Dilger
2002-07-12 20:34 ` Chris Mason
2002-07-13  4:44 ` Daniel Phillips
2002-07-14 20:40 ` Dax Kelson
2002-07-15  8:26   ` Sam Vilain
2002-07-15 12:30     ` Alan Cox
2002-07-15 12:02       ` Sam Vilain
2002-07-15 13:23         ` Alan Cox
2002-07-15 13:40           ` Chris Mason
2002-07-15 19:40             ` Andrew Morton
2002-07-15 15:12         ` Andrea Arcangeli
2002-07-15 16:03         ` Andreas Dilger
2002-07-15 16:12           ` Daniel Phillips
2002-07-15 17:48           ` Sam Vilain
2002-07-15 18:47             ` Mathieu Chouquet-Stringer
2002-07-15 19:26               ` Sam Vilain
2002-07-16  8:18               ` Stelian Pop
2002-07-16 12:22                 ` Gerhard Mack
2002-07-16 12:49                   ` Stelian Pop
2002-07-16 15:11                     ` Gerhard Mack
2002-07-16 15:22                       ` Andrea Arcangeli
2002-07-16 15:39                       ` Stelian Pop
2002-07-16 19:45                         ` Matthias Andree
2002-07-16 20:04                           ` Shawn
2002-07-16 20:11                             ` Mathieu Chouquet-Stringer
2002-07-16 20:22                               ` Shawn
2002-07-16 20:27                                 ` Mathieu Chouquet-Stringer
2002-07-17 11:45                                 ` Matthias Andree
2002-07-17 19:02                                   ` Andreas Dilger
2002-07-18  9:29                                     ` Matthias Andree
2002-07-19  8:29                                     ` Matthias Andree
2002-07-19 16:39                                       ` Andreas Dilger
2002-07-19 20:01                                         ` Shawn
2002-07-19 20:47                                           ` Andreas Dilger
2002-07-15 21:14             ` Andreas Dilger
2002-07-17 18:41               ` bill davidsen
2002-07-16  8:15             ` Stelian Pop
2002-07-16 12:27               ` Matthias Andree
2002-07-16 12:43                 ` Stelian Pop
2002-07-16 12:53                   ` Matthias Andree
2002-07-16 13:05                     ` Christoph Hellwig
2002-07-16 19:38                       ` Matthias Andree
2002-07-16 19:49                         ` Andreas Dilger
2002-07-16 20:11                         ` Thunder from the hill
2002-07-16 21:06                           ` Matthias Andree
2002-07-16 21:23                             ` Andreas Dilger
2002-07-16 21:38                               ` Thunder from the hill
2002-07-17 11:47                               ` Matthias Andree
2002-07-18 14:50                               ` Bill Davidsen
2002-07-18 15:09                                 ` Rik van Riel
2002-07-17 18:51                     ` bill davidsen
2002-07-18  9:32                       ` Matthias Andree
2002-07-15 12:09       ` Matti Aarnio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5gsn2kst2j.fsf@egghead.curl.com \
    --to=patl@curl.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).