coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] copy: adjust fiemap handling of sparse files


From: Jim Meyering
Subject: Re: [PATCH] copy: adjust fiemap handling of sparse files
Date: Fri, 18 Mar 2011 19:17:22 +0100

Eric Sandeen wrote:
...
> The testcase in coreutils should definitely remove the fdatasync
> hack, as that just makes the test pass without worrying about things
> in the real world.  :)  A better test suite might be to generate
> random holey / delalloc files and copy those around.
>
> We should write an xfstests test to do the same thing, if we can
> determine whether we have a "cp" that knows about fiemap?

On ext4, FIEMAP-enabled cp will preserve the hole in this file,
but older versions will not:

perl -e 'sysseek (*STDOUT, 4096, 1) && print "a" or die "$!"' > j
cp j k; test $(stat --format %b j) = $(stat --format %b k) \
  || { du -sh j k; echo FAIL; }

With cp from coreutils-8.10, both k and j occupy 8 blocks on ext4.
Using F14's /bin/cp (coreutils-8.5+), k occupies 16 blocks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]