From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from imap.thunk.org ([74.207.234.97]:57896 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981AbeFCD3B (ORCPT ); Sat, 2 Jun 2018 23:29:01 -0400 Date: Sat, 2 Jun 2018 23:28:53 -0400 From: "Theodore Y. Ts'o" To: Eric Sandeen Cc: Carlos Maiolino , linux-fsdevel@vger.kernel.org, david@fromorbit.com, hch@infradead.org Subject: Re: Ext4 fiemap implementation Message-ID: <20180603032853.GA3585@thunk.org> References: <20180601123621.avcgzyedbiqxlktf@odin.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Jun 01, 2018 at 10:01:54AM -0500, Eric Sandeen wrote: > > Ted, is there any restriction why ext4_fiemap isn't using iomap_fiemap()? Or any > > reason why ext4 fiemap always returns the offset from the beginning of the > > extent? Would you oppose to have it updated to return the offset initially > > requested? Or maybe, change ext4_fiemap() to use iomap_fiemap()? ext4_fiemap() predates iomap_fiemap(). In fact, it used to be that all of the file systems had their own fiemap() implementation. > > I read the fiemap documentation, but I didn't get a clear understanding if > > fiemap should be returning the beginning of the extent, the offset initially > > requested, or if it depends on FS implementation. > > I think the fiemap docs[1] explicitly state that ext4's behavior is valid: > > > Extents returned mirror > > those on disk - that is, the logical offset of the 1st returned extent > > may start before fm_start, and the range covered by the last returned > > extent may end after fm_length. Actually, I read, "Extents returned mirror those on disk" as meaning that the ext4 behavior is *mandated* by the docs. It would be interesting to see what XFS did before the iomap_fiemap() conversion. Or it could have been that the docs were inconsistent with what XFS was doing and then when when ext4_fiemap() was implemented, we followed the docs. Some software archeology would be required to know for sure. - Ted