modprobe btrfs > /dev/null 2>&1
[ -e /sys/fs/btrfs/features/$feat ] || \
_notrun "Feature $feat not supported by the available btrfs version"
+
+ if [ $feat = "raid56" ]; then
+ # Zoned btrfs only supports SINGLE profile
+ _require_non_zoned_device "${SCRATCH_DEV}"
+ fi
}
_require_btrfs_fs_sysfs()
else
local unsupported=()
fi
+
+ if _scratch_btrfs_is_zoned; then
+ # Zoned btrfs only supports SINGLE profile
+ unsupported+=(
+ "dup"
+ "raid0"
+ "raid1"
+ "raid1c3"
+ "raid1c4"
+ "raid10"
+ "raid5"
+ "raid6"
+ )
+ fi
+
for unsupp in "${unsupported[@]}"; do
if [ "${profiles[0]}" == "$unsupp" -o "${profiles[1]}" == "$unsupp" ]; then
if [ -z "$BTRFS_PROFILE_CONFIGS" ]; then
{
$BTRFS_UTIL_PROG device scan &> /dev/null
}
+
+_scratch_btrfs_is_zoned()
+{
+ [ `_zone_type ${SCRATCH_DEV}` != "none" ] && return 0
+ return 1
+}
_scratch_unmount
}
-_test_raid0
-_test_raid1
-_test_raid10
+# Zoned btrfs only supports SINGLE profile
+if ! _scratch_btrfs_is_zoned; then
+ _test_raid0
+ _test_raid1
+ _test_raid10
+fi
+
_test_single
_test_add
-_test_replace
+# _test_replace() uses raid1, but zoned btrfs only supports SINGLE
+# profile
+if ! _scratch_btrfs_is_zoned; then
+ _test_replace
+fi
_test_remove
echo "Silence is golden"
}
workout "-m single -d single" 1 no 64
-workout "-m single -d single -M" 1 no 64
-workout "-m dup -d single" 1 no 64
-workout "-m dup -d single" 1 cancel 1024
-workout "-m dup -d dup -M" 1 no 64
-workout "-m raid0 -d raid0" 2 no 64
-workout "-m raid1 -d raid1" 2 no 2048
-workout "-m raid5 -d raid5" 2 no 64
-workout "-m raid6 -d raid6" 3 no 64
-workout "-m raid10 -d raid10" 4 no 64
+# Mixed BG & RAID/DUP profiles are not supported on zoned btrfs
+if ! _scratch_btrfs_is_zoned; then
+ workout "-m dup -d single" 1 no 64
+ workout "-m dup -d single" 1 cancel 1024
+ workout "-m raid0 -d raid0" 2 no 64
+ workout "-m raid1 -d raid1" 2 no 2048
+ workout "-m raid10 -d raid10" 4 no 64
+ workout "-m single -d single -M" 1 no 64
+ workout "-m dup -d dup -M" 1 no 64
+ workout "-m raid5 -d raid5" 2 no 64
+ workout "-m raid6 -d raid6" 3 no 64
+fi
echo "*** done"
status=0
_require_command "$BTRFS_CONVERT_PROG" btrfs-convert
_require_command "$MKFS_EXT4_PROG" mkfs.ext4
_require_command "$E2FSCK_PROG" e2fsck
+# ext4 does not support zoned block device
+_require_non_zoned_device "${SCRATCH_DEV}"
_require_fs_space $SCRATCH_MNT $(du -s /lib/modules/`uname -r` | ${AWK_PROG} '{print $1}')
# real QA test starts here
_supported_fs btrfs
_require_scratch_dev_pool 4
+# Zoned btrfs only supports SINGLE profile
+_require_non_zoned_device "${SCRATCH_DEV}"
create_group_profile()
{
_supported_fs btrfs
_require_scratch
_require_dm_target flakey
+# Zoned btrfs does not support inode cache
+_require_non_zoned_device "$SCRATCH_DEV"
_scratch_mkfs >> $seqres.full 2>&1
# real QA test starts here
_supported_fs btrfs
_require_scratch
+# Writing non-contiguous data directly to the device
+_require_non_zoned_device $SCRATCH_DEV
_scratch_mkfs >>$seqres.full 2>&1
dev1=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
dev2=`echo $SCRATCH_DEV_POOL | awk '{print $2}'`
+# RAID1 is not supported on zoned btrfs
+_require_non_zoned_device "$dev1"
+_require_non_zoned_device "$dev2"
+
dev1_sz=`blockdev --getsize64 $dev1`
dev2_sz=`blockdev --getsize64 $dev2`
# get min of both
_require_scratch
_require_btrfs_command inspect-internal dump-super
_require_btrfs_fs_feature free_space_tree
+# Zoned btrfs does not support space_cache(v1)
+_require_non_zoned_device "${SCRATCH_DEV}"
mkfs_v1()
{
# Modify as appropriate.
_supported_fs btrfs
_require_scratch_nocheck
+# ext4 does not support zoned block device
+_require_non_zoned_device "${SCRATCH_DEV}"
_require_command "$BTRFS_CONVERT_PROG" btrfs-convert
_require_command "$MKFS_EXT4_PROG" mkfs.ext4
_require_btrfs_command inspect-internal dump-tree
_require_command "$FILEFRAG_PROG" filefrag
_require_odirect
+# Overwriting data is forbidden on a zoned block device
+_require_non_zoned_device "${SCRATCH_DEV}"
get_physical()
{
$BTRFS_UTIL_PROG device del $device_1 $SCRATCH_MNT
$BTRFS_UTIL_PROG device add -f $device_1 $SCRATCH_MNT
$BTRFS_UTIL_PROG device del $device_2 $SCRATCH_MNT
-done
+done | grep -v 'Resetting device zone'
_scratch_dev_pool_put
echo "Silence is golden"
# Modify as appropriate.
_supported_fs btrfs
_require_scratch_dev_pool 4
+# Zoned btrfs only supports SINGLE profile
+_require_non_zoned_device "${SCRATCH_DEV}"
declare -a TEST_VECTORS=(
# $nr_dev_min:$data:$metadata:$data_convert:$metadata_convert
_require_test
_require_scratch
_require_scratch_dev_pool 5
+# Zoned btrfs only supports SINGLE profile
+_require_non_zoned_device ${SCRATCH_DEV}
workout()
{
_require_command "$WIPEFS_PROG" wipefs
_require_scratch
_require_scratch_dev_pool 4
+# Zoned btrfs only supports SINGLE profile
+_require_non_zoned_device ${SCRATCH_DEV}
workout()
{
# Modify as appropriate.
_supported_fs btrfs
+# Overwriting data is forbidden on a zoned block device
+_require_non_zoned_device $SCRATCH_DEV
_scratch_mkfs > /dev/null
# disable freespace inode to ensure file is the first thing in the data
test_fsync "link_cow_$i" "link"
done
-# Now lets test with nodatacow.
_unmount_flakey
-MOUNT_OPTIONS="-o nodatacow"
-_mount_flakey
-echo "Testing fsync after rename with NOCOW writes"
-for ((i = 1; i <= 3; i++)); do
- test_fsync "rename_nocow_$i" "rename"
-done
-echo "Testing fsync after link with NOCOW writes"
-for ((i = 1; i <= 3; i++)); do
- test_fsync "link_nocow_$i" "link"
-done
-
-_unmount_flakey
+# Now lets test with nodatacow.
+if ! _scratch_btrfs_is_zoned; then
+ MOUNT_OPTIONS="-o nodatacow"
+ _mount_flakey
+
+ echo "Testing fsync after rename with NOCOW writes"
+ for ((i = 1; i <= 3; i++)); do
+ test_fsync "rename_nocow_$i" "rename"
+ done
+ echo "Testing fsync after link with NOCOW writes"
+ for ((i = 1; i <= 3; i++)); do
+ test_fsync "link_nocow_$i" "link"
+ done
+
+ _unmount_flakey
+else
+ # Fake result. Zoned btrfs does not support NOCOW
+ echo "Testing fsync after rename with NOCOW writes"
+ echo "Testing fsync after link with NOCOW writes"
+fi
status=0
exit