xfs
[Top] [All Lists]

Re: Files full of zeros with coreutils-8.11 and xfs (FIEMAP related?)

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: Files full of zeros with coreutils-8.11 and xfs (FIEMAP related?)
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 20 Apr 2011 11:29:56 -0400
Cc: "Ted Ts'o" <tytso@xxxxxxx>, Yongqiang Yang <xiaoqiangnk@xxxxxxxxx>, Andreas Dilger <adilger@xxxxxxxxx>, Eric Sandeen <sandeen@xxxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>, "coreutils@xxxxxxx" <coreutils@xxxxxxx>, "linux-ext4@xxxxxxxxxxxxxxx" <linux-ext4@xxxxxxxxxxxxxxx>, P?draig Brady <P@xxxxxxxxxxxxxx>, Markus Trippelsdorf <markus@xxxxxxxxxxxxxxx>
In-reply-to: <20110419210825.GJ23985@dastard>
References: <E7438588-5C5A-42B9-9B6C-FADF7CAC6D3A@xxxxxxxxx> <4EEEA16E-1FDB-4430-A372-8F8701196E4C@xxxxxxx> <20110418004040.GS21395@dastard> <6C89E159-A5F6-4A06-A3D2-273BE4CFB9B5@xxxxxxxxx> <BANLkTin=WEpSf6ddiOMNMOpCPP-wiEttSw@xxxxxxxxxxxxxx> <20110419034455.GB23985@dastard> <BANLkTinjh968ECqAobQ677hnV5yzke1ncw@xxxxxxxxxxxxxx> <20110419074538.GG23985@dastard> <20110419140909.GD3030@xxxxxxxxx> <20110419210825.GJ23985@dastard>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Apr 20, 2011 at 07:08:25AM +1000, Dave Chinner wrote:
> So, it logically follws that you need to use the SYNC flag for both
> unwritten extents and delalloc extents to find out where there data
> realy lies by converting them to real, written extents. i.e. the
> only extents you can trust contain data from FIEMAP are the real
> extents on disk....

Even more funny is that the bug report that started this thread involved
software that didn't actually care about the location on disk, at all.

cp from coreutils really just wanted an efficient way to skip holes
in sparse files, and we got into a chain reaction of various flaws
and oversights :

 (1) Linux lacks the SEEK_HOLE/SEEK_DATA interface that would make
     skipping holes trivial and thus coreutils has to use FIEMAP.
 (2) ext4 and btrfs in some cases mishandled reporting delalloc
     extents, which means coreutils had to add the sync flag,
     despite not caring where data is on disk
 (3) coreutils tried to treat unwrittent extents as holes.  Which
     makes some sense given their high-level description, although
     probably not too much in practice given that we explicitly
     allocated blocks to these "holes" to optimize performance.
     But the main issue here is that there is no documentation
     that clearly states that unwrittent extents reported by
     FIEMAP may actually contain useful data.  In fact there's
     no useful documentation for FIEMAP outside the kernel tree.
     And interface that complex really needs a manpage.

<Prev in Thread] Current Thread [Next in Thread>