xfs
[Top] [All Lists]

Re: [PATCH] xfstests: btrfs/308: simple sparse copy testcase for btrfs

To: Eryu Guan <eguan@xxxxxxxxxx>
Subject: Re: [PATCH] xfstests: btrfs/308: simple sparse copy testcase for btrfs
From: Eric Sandeen <sandeen@xxxxxxxxxx>
Date: Thu, 23 May 2013 23:21:24 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>, linux-btrfs <linux-btrfs@xxxxxxxxxxxxxxx>, Koen De Wit <koen.de.wit@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130524030903.GL2460@xxxxxxxxxxxxxxxxxxxxxxxxx>
References: <519E4590.4080309@xxxxxxxxxx> <20130524030903.GL2460@xxxxxxxxxxxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
On 5/23/13 10:09 PM, Eryu Guan wrote:
> On Thu, May 23, 2013 at 11:36:32AM -0500, Eric Sandeen wrote:
>> From: Koen De Wit <koen.de.wit@xxxxxxxxxx>
>>
>> # Tests file clone functionality of btrfs ("reflinks"):
>> #   - Reflink a file
>> #   - Reflink the reflinked file
>> #   - Modify the original file
>> #   - Modify the reflinked file
>>
>> [sandeen: add helpers, make several mostly-cosmetic
>>  changes to the original testcase]
>>
>> Signed-off-by: Koen De Wit <koen.de.wit@xxxxxxxxxx>
>> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
>> ---
>>
>> Originally submitted as test 297
>>
>> diff --git a/common/rc b/common/rc
>> index fe6bbfc..4560715 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -2098,6 +2098,27 @@ _require_dumpe2fs()
>>      fi
>>  }
>>  
>> +_require_cp_reflink()
>> +{
>> +    cp --help | grep -q reflink || \
>> +            _notrun "This test requires a cp with --reflink support."
>> +}
>> +
>> +# Given 2 files, verify that they have the same mapping but different
>> +# inodes - i.e. an undisturbed reflink
>> +# Silent if so, make noise if not
>> +_verify_reflink()
>> +{
>> +    # not a hard link or symlink?
>> +    cmp -s  <(stat -c '%i' $1) <(stat -c '%i' $2) \
>> +            && echo "$1 and $2 are not reflinks: same inode number"
>> +
>> +    # same mapping?
>> +    diff -u <($XFS_IO_PROG -F -c "fiemap" $1 | grep -v $1) \
>> +            <($XFS_IO_PROG -F -c "fiemap" $2 | grep -v $2) \
>> +            || echo "$1 and $2 are not reflinks: different extents"
> 
> I'm not sure if "-F" is still needed after commit
> 96fce07 xfstests: automatically add -F to xfs_io on non-xfs

Right, it's not, oops.  :( Old habits (and old patch, TBH)

I can fix & resend all of them I guess.

Thanks,
-Eric

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