Re: Ext4 fiemap implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux