public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Patrick Goetz <pgoetz@math.utexas.edu>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Atomicity or the ext4 open-write-close-rename debacle
Date: Wed, 08 Apr 2009 19:12:52 -0400	[thread overview]
Message-ID: <1239232372.31826.4.camel@think.oraclecorp.com> (raw)
In-Reply-To: <49DCECD5.3030801@math.utexas.edu>

On Wed, 2009-04-08 at 13:28 -0500, Patrick Goetz wrote:
> Chris Mason wrote:
> > 
> > With 2.6.30, extra ordering is added to btrfs, making sure that metadata
> > and data are both atomically replaced during a rename.  In other words,
> > for renames it will work like ext3 data=ordered mode.
> > 
> 
> Thanks for the speedy response.
> 
> After spending several hours slogging through the discussion on Ted 
> Tso's blog and spending much more time than anticipated learning about 
> FUA, write barriers, fsync vs. fdatasync, how fsync is implemented in 
> linux, etc., I'm curious about the technical details of how this is 
> accomplished.  Any place where I can find this short of reading through 
> the source code?

The rename flushing is pretty simple.  When one file replaces another
during rename, btrfs puts the new file into a list of things that must
be flushed before the transaction commits.

This way, we know the data is on disk before the rename metadata changes
are on disk.

-chris



      reply	other threads:[~2009-04-08 23:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08 15:21 Atomicity or the ext4 open-write-close-rename debacle Patrick Goetz
2009-04-08 16:28 ` Chris Mason
2009-04-08 18:28   ` Patrick Goetz
2009-04-08 23:12     ` Chris Mason [this message]

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=1239232372.31826.4.camel@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=pgoetz@math.utexas.edu \
    /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