From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Mason Subject: Re: [PATCH RFC] Ext3 data=guarded Date: Thu, 17 Sep 2009 18:19:23 -0400 Message-ID: <20090917221923.GB21798@think> References: <1252422595-4554-1-git-send-email-chris.mason@oracle.com> <20090917215309.GD10599@shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: jack@suse.cz, tytso@mit.edu, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Jamie Lokier Return-path: Content-Disposition: inline In-Reply-To: <20090917215309.GD10599@shareable.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.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