From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Chinner Subject: Re: [PATCH 0/4] Fiemap, an extent mapping ioctl - round 2 Date: Thu, 3 Jul 2008 21:17:26 +1000 Message-ID: <20080703111726.GZ29319@disturbed> References: <20080625221835.GQ28100@wotan.suse.de> <1214489061.6237.16.camel@norville.austin.ibm.com> <4863A483.5060303@redhat.com> <1214490465.6237.24.camel@norville.austin.ibm.com> <486C13B7.4030402@hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: jim owens Return-path: Received: from ipmail01.adl6.internode.on.net ([203.16.214.146]:28333 "EHLO ipmail01.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750964AbYGCMHV (ORCPT ); Thu, 3 Jul 2008 08:07:21 -0400 Content-Disposition: inline In-Reply-To: <486C13B7.4030402@hp.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Jul 02, 2008 at 07:48:07PM -0400, jim owens wrote: > I'm back from vacation and ready to cause fiemap() trouble. > > Dave Kleikamp wrote: >> On Thu, 2008-06-26 at 09:15 -0500, Eric Sandeen wrote: >> >>>> SYNC really doesn't look like it belongs, and it's only there so that >>>> the new ioctl acts like the xfs ioctl. >>> >>> I disagree, while it may have been inspired by the xfs behavior, it's >>> not at all xfs specific. >>> >>> If a filesystem implements delalloc, you may want to know which ranges >>> are still delalloc in the fiemap output, or you may want to put them on >>> disk and know the actual physical location. And if you want a snapshot >>> of an actual, consistent layout of the file at a point in time, then you >>> need an atomic sync+map - for any filesystem. >> >> This makes sense. In fact, I could see always doing the sync if there >> are delalloc blocks to ensure that the location of the blocks will >> always be returned. >> > > I guess I was put off by Andreas' response that FIEMAP_FLAG_SYNC is >> there because xfsbmap had it "isn't harmful either". This seemed a bit >> weak, but I see that there is a better justification than just that. > > I say IT IS HARMFUL to have the FIEMAP_FLAG_SYNC. > > The email trail points out how this so-called atomic sync+map > will lead programmers to write bad code because it leads them > to think there is some valuable guarantee of consistency by > using the SYNC flag. This is not true. xfs_bmap provides an atomic sync and mapping. If the FIEMAP_FLAG_SYNC is pushed down to the filesystem, then XFS and all other filesystems can provide that same atomicity if desired. Cheers, Dave. -- Dave Chinner david@fromorbit.com