btrfs: sparse copy between different filesystems/mountpoints

Check if creating a sparse copy ("reflink") of a file on btrfs
expectedly fails when it's done between different filesystems or
different mount points of the same filesystem.

For both situations, these actions are executed:
   - Copy a file with the reflink=auto option.
     A normal copy should be created.
   - Copy a file with the reflink=always option. Should result in
     error.

[sandeen: mostly cosmetic changes]

Signed-off-by: Koen De Wit <koen.de.wit@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Koen De Wit
2014-01-20 13:56:37 +11:00
committed by Dave Chinner
parent 9b48c972a9
commit 30997917e5
3 changed files with 124 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
QA output created by 029
test reflinks across different devices
reflink=auto:
42d69d1a6d333a7ebdf64792a555e392 TEST_DIR/test-029/original
42d69d1a6d333a7ebdf64792a555e392 SCRATCH_MNT/test-029/copy
reflink=always:
cp: failed to clone 'SCRATCH_MNT/test-029/copyfail': Invalid cross-device link
SCRATCH_MNT/test-029/copyfail
test reflinks across different mountpoints of same device
reflink=auto:
42d69d1a6d333a7ebdf64792a555e392 TEST_DIR/test-029/original
42d69d1a6d333a7ebdf64792a555e392 SCRATCH_MNT/test-bis-029/copy
reflink=always:
cp: failed to clone 'SCRATCH_MNT/test-bis-029/copyfail': Invalid cross-device link
SCRATCH_MNT/test-bis-029/copyfail