From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ipmail01.adl6.internode.on.net ([150.101.137.136]:40399 "EHLO ipmail01.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933242AbeFMDcI (ORCPT ); Tue, 12 Jun 2018 23:32:08 -0400 Date: Wed, 13 Jun 2018 13:32:04 +1000 From: Dave Chinner To: "Theodore Y. Ts'o" Cc: Mark Fasheh , Carlos Maiolino , "Darrick J. Wong" , Eric Sandeen , linux-fsdevel@vger.kernel.org, hch@infradead.org Subject: Re: Ext4 fiemap implementation Message-ID: <20180613033204.GC5651@dastard> References: <20180601123621.avcgzyedbiqxlktf@odin.usersys.redhat.com> <20180603032853.GA3585@thunk.org> <20180604164309.GB23842@magnolia> <20180608224126.GD28053@wotan.suse.de> <20180611072827.arsyq56m7ptnedig@odin.usersys.redhat.com> <20180612235203.GE28053@wotan.suse.de> <20180613030601.GB3340@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180613030601.GB3340@thunk.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Jun 12, 2018 at 11:06:01PM -0400, Theodore Y. Ts'o wrote: > On Wed, Jun 13, 2018 at 01:52:03AM +0200, Mark Fasheh wrote: > > > > > > So, you are saying iomap implementation violates FIEMAP specs? > > > > Does iomap do this or just XFS? At any rate, the doc should be read > > as Ted suggests: '"Extents returned mirror those on disk" as meaning > > that the ext4 behavior is *mandated* by the docs.' > > > > So anything that's mainipulating the returned extents solely to > > 'fit' them into a request is wrong. > > Well, or the FIEMAP specs could be changed. If I recall correctly the > FIEMAP implementation by the various file systems predates the > documentation. I suspect whoever wrote the docs looked at the > ext2/ext3/ext4 implementation and used that to write the > documentation. If other file systems were doing something else, I'd > be in favor of allowing either behavior, since userspace programs who > care will need to accomodate either behavior. Fortunately, I suspect > it matters for very few (if any) userspace programs. The horse has bolted - we can't redefine the expected behaviour as that might break apps like cp (yes, it's still using FIEMAP for sparse file optimisations). IIRC, extended range reporting wasn't even intended for expanding normal extents the way ext4 is reporting them - it was intended to allow reporting of mappings where the calculation of exact logical->physical mappings (i.e. trimming to the user specified logical range) was too complex or prohibitively expensive. e.g. compressed extents (FIEMAP_EXTENT_ENCODED) where we may know the logical offset range of the physical extent, but we don't know the exact mapping of logical offsets within the physical extent without actually reading and decoding the physical extent. Cheers, Dave. -- Dave Chinner david@fromorbit.com