btrfs: add test for btrfs cloning with file holes

Regression test for the btrfs ioctl clone operation when the source range
contains hole(s) and the FS has the NO_HOLES feature enabled (file holes
don't need file extent items in the btree to represent them).

This issue is fixed by the following linux kernel btrfs patch:

    Btrfs: fix clone to deal with holes when NO_HOLES feature is enabled

Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Filipe David Borba Manana
2014-06-18 09:29:00 +10:00
committed by Dave Chinner
parent 45d1fac130
commit 36271c9b68
4 changed files with 538 additions and 0 deletions
+25
View File
@@ -2177,6 +2177,31 @@ _require_btrfs_send_stream_version()
fi
}
_require_btrfs_mkfs_feature()
{
if [ -z $1 ]; then
echo "Missing feature name argument for _require_btrfs_mkfs_feature"
exit 1
fi
feat=$1
$MKFS_BTRFS_PROG -O list-all 2>&1 | \
grep '^[ \t]*'"$feat"'\b' > /dev/null 2>&1
[ $? -eq 0 ] || \
_notrun "Feature $feat not supported in the available version of mkfs.btrfs"
}
_require_btrfs_fs_feature()
{
if [ -z $1 ]; then
echo "Missing feature name argument for _require_btrfs_fs_feature"
exit 1
fi
feat=$1
modprobe btrfs > /dev/null 2>&1
[ -e /sys/fs/btrfs/features/$feat ] || \
_notrun "Feature $feat not supported by the available btrfs version"
}
init_rc()
{
if [ "$iam" == new ]