# get standard environment, filters and checks
. ./common/rc
. ./common/filter
+. ./common/filter.btrfs
# real QA test starts here
_supported_fs btrfs
# clone the inline extent from file bar into this file.
$XFS_IO_PROG -f -c "pwrite -S 0xaa 0K 16K" $SCRATCH_MNT/foo \
| _filter_xfs_io
- $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo
+ $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo \
+ | _filter_btrfs_cloner_error
# Doing IO against any range in the first 4K of the file should work.
# Due to a past clone ioctl bug which allowed cloning the inline extent,
# as well to clone the inline extent from file bar into this file.
$XFS_IO_PROG -f -c "pwrite -S 0xdd 4K 12K" $SCRATCH_MNT/foo2 \
| _filter_xfs_io
- $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo2
+ $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo2 \
+ | _filter_btrfs_cloner_error
# Doing IO against any range in the first 4K of the file should work.
# Due to a past clone ioctl bug which allowed cloning the inline extent,
# but has a prealloc extent. It should not be possible as well to clone
# the inline extent from file bar into this file.
$XFS_IO_PROG -f -c "falloc -k 0 1M" $SCRATCH_MNT/foo3 | _filter_xfs_io
- $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo3
+ $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo3 \
+ | _filter_btrfs_cloner_error
# Doing IO against any range in the first 4K of the file should work.
# Due to a past clone ioctl bug which allowed cloning the inline extent,
# It should be possible to do the extent cloning from bar to this file.
$XFS_IO_PROG -f -c "pwrite -S 0x01 0 40" $SCRATCH_MNT/foo4 \
| _filter_xfs_io
- $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo4
+ $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo4 \
+ | _filter_btrfs_cloner_error
# Doing IO against any range in the first 4K of the file should work.
echo "File foo4 data after clone operation:"
# into this file.
$XFS_IO_PROG -f -c "pwrite -S 0x03 0 60" $SCRATCH_MNT/foo5 \
| _filter_xfs_io
- $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo5
+ $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo5 \
+ | _filter_btrfs_cloner_error
# Reading the file should not fail.
echo "File foo5 data after clone operation:"
# It should not be possible to clone the inline extent from file bar
# into this file.
$XFS_IO_PROG -f -c "truncate 16K" $SCRATCH_MNT/foo6 | _filter_xfs_io
- $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo6
+ $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo6 \
+ | _filter_btrfs_cloner_error
# Reading the file should not fail.
echo "File foo6 data after clone operation:"
# It should be possible to clone the inline extent from file bar into
# this file.
$XFS_IO_PROG -f -c "truncate 30" $SCRATCH_MNT/foo7 | _filter_xfs_io
- $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo7
+ $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo7 \
+ | _filter_btrfs_cloner_error
# Reading the file should not fail.
echo "File foo7 data after clone operation:"
$XFS_IO_PROG -f -c "falloc -k 0 1M" \
-c "pwrite -S 0x88 0 20" \
$SCRATCH_MNT/foo8 | _filter_xfs_io
- $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo8
+ $CLONER_PROG -s 0 -d 0 -l 0 $SCRATCH_MNT/bar $SCRATCH_MNT/foo8 \
+ | _filter_btrfs_cloner_error
echo "File foo8 data after clone operation:"
# Must have a size of 20 bytes, with all bytes having a value of 0x88
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 16384/16384 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo data after clone operation:
0000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
*
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 12288/12288 bytes at offset 4096
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo2 data after clone operation:
0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0040000
wrote 90/90 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
First 50 bytes of foo3 after clone operation:
0000000
wrote 90/90 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 60/60 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo5 data after clone operation:
0000000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
0000060 03 03 03 03 03 03 03 03 03 03 03 03
0000074
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo6 data after clone operation:
0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0000062
wrote 20/20 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo8 data after clone operation:
0000000 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88
0000020 88 88 88 88
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 16384/16384 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo data after clone operation:
0000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
*
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 12288/12288 bytes at offset 4096
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo2 data after clone operation:
0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0040000
wrote 90/90 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
First 50 bytes of foo3 after clone operation:
0000000
wrote 90/90 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 60/60 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo5 data after clone operation:
0000000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
0000060 03 03 03 03 03 03 03 03 03 03 03 03
0000074
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo6 data after clone operation:
0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0000062
wrote 20/20 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo8 data after clone operation:
0000000 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88
0000020 88 88 88 88
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 16384/16384 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo data after clone operation:
0000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
*
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 12288/12288 bytes at offset 4096
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo2 data after clone operation:
0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0040000
wrote 90/90 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
First 50 bytes of foo3 after clone operation:
0000000
wrote 90/90 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 60/60 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo5 data after clone operation:
0000000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
0000060 03 03 03 03 03 03 03 03 03 03 03 03
0000074
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo6 data after clone operation:
0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0000062
wrote 20/20 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo8 data after clone operation:
0000000 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88
0000020 88 88 88 88
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 16384/16384 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo data after clone operation:
0000000 aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
*
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 12288/12288 bytes at offset 4096
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo2 data after clone operation:
0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0040000
wrote 90/90 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
First 50 bytes of foo3 after clone operation:
0000000
wrote 90/90 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
wrote 60/60 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo5 data after clone operation:
0000000 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03
*
0000060 03 03 03 03 03 03 03 03 03 03 03 03
0000074
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo6 data after clone operation:
0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0000062
wrote 20/20 bytes at offset 0
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-clone failed: Operation not supported
+clone failed: Invalid argument
File foo8 data after clone operation:
0000000 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88
0000020 88 88 88 88