From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Lokier Subject: Re: Proposal for "proper" durable fsync() and fdatasync() Date: Tue, 26 Feb 2008 17:29:13 +0000 Message-ID: <20080226172913.GB22471@shareable.org> References: <20080226072649.GB30238@shareable.org> <20080225234319.f4589ae4.akpm@linux-foundation.org> <20080226075921.GG30238@shareable.org> <200802262016.11297.nickpiggin@yahoo.com.au> <20080226140925.GB20428@lazybastard.org> <20080226152810.GB18118@shareable.org> <20080226170214.GA23829@lazybastard.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Nick Piggin , Andrew Morton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Chris Wedgwood To: =?iso-8859-1?Q?J=F6rn?= Engel Return-path: Received: from mail2.shareable.org ([80.68.89.115]:52024 "EHLO mail2.shareable.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760375AbYBZR33 (ORCPT ); Tue, 26 Feb 2008 12:29:29 -0500 Content-Disposition: inline In-Reply-To: <20080226170214.GA23829@lazybastard.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: J=F6rn Engel wrote: > On Tue, 26 February 2008 15:28:10 +0000, Jamie Lokier wrote: > >=20 > > > One interesting aspect of this comes with COW filesystems like bt= rfs or > > > logfs. Writing out data pages is not sufficient, because those w= ill get > > > lost unless their referencing metadata is written as well. So ei= ther we > > > have to call fsync for those filesystems or add another callback = and let > > > filesystems override the default implementation. > >=20 > > Doesn't the ->fsync callback get called in the sys_fdatasync() case= , > > with appropriate arguments? >=20 > My paragraph above was aimed at the sync_file_range() case. fsync an= d > fdatasync do the right thing within the limitations you brought up in > this thread. sync_file_range() without further changes will only wri= te > data pages, not the metadata required to actually access those data > pages. This works just fine for non-COW filesystems, which covers al= l > currently merged ones. >=20 > With COW filesystems it is currently impossible to do sync_file_range= () > properly. The problem is orthogonal to your's, I just brought it up > since you were already mentioning sync_file_range(). You're right. Though, doesn't normal page writeback enqueue the COW metadata changes? If not, how do they get written in a timely fashion? -- Jamie - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html