linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Jamie Lokier <jamie@shareable.org>
Cc: jack@suse.cz, tytso@mit.edu, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH RFC] Ext3 data=guarded
Date: Thu, 17 Sep 2009 18:19:23 -0400	[thread overview]
Message-ID: <20090917221923.GB21798@think> (raw)
In-Reply-To: <20090917215309.GD10599@shareable.org>

On Thu, Sep 17, 2009 at 10:53:09PM +0100, Jamie Lokier wrote:
> Chris Mason wrote:
> > The main difference from data=ordered is that data=guarded only updates
> > the on disk i_size after all of the data blocks are on disk.  This allows
> > us to avoid flushing all the data pages down to disk with every commit.
> 
> I'm a bit confused, because I thought that was already guaranteed by
> ext3 data=ordered, due to the following mail:

Well, in data=ordered mode, we update the on disk i_size immediately.
This means that when the current transaction commits, the on disk i_size
reflects everything that has been written from file_write.

In order to avoid exposing stale data in data=ordered, we must force all
the dirty data down to disk before the transaction commits.

In data=guarded mode, we update the on disk i_size after all the data IO
is complete.  This may happen in a later transaction than the original
file write, but it allows us to avoid exposing stale data because the
i_size on disk is never bumped up until the data isn't stale anymore.

In data=guarded mode, the orphan list is used to make sure that all of
the metadata related to bytes that exist past the on disk i_size is
properly dealt with if we crash before the on disk i_size is updated.

data=guarded makes no ordering promises about overwriting existing
blocks inside of i_size.

-chris

      reply	other threads:[~2009-09-17 22:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-08 15:09 [PATCH RFC] Ext3 data=guarded Chris Mason
2009-09-08 15:09 ` [PATCH 1/2] Ext3: Fix race in ext3_mark_inode_dirty Chris Mason
2009-09-08 15:09 ` [PATCH 2/2] Ext3: data=guarded mode Chris Mason
2009-09-15 17:29   ` Jan Kara
2009-09-15 18:39     ` Chris Mason
2009-09-16 14:09       ` Jan Kara
2009-09-16 14:37         ` Chris Mason
2009-09-21 16:29     ` Chris Mason
2009-09-24 16:16       ` Chris Mason
2009-09-17 21:53 ` [PATCH RFC] Ext3 data=guarded Jamie Lokier
2009-09-17 22:19   ` 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=20090917221923.GB21798@think \
    --to=chris.mason@oracle.com \
    --cc=jack@suse.cz \
    --cc=jamie@shareable.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.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;
as well as URLs for NNTP newsgroup(s).