On Sun, Aug 15, 2021 at 11:12:21PM +0800, Eryu Guan wrote: > On Thu, Aug 12, 2021 at 12:12:31AM +0900, Naohiro Aota wrote: > > Modify btrfs tests to require non-zoned block device or limit some part of > > tests not to be run on zone block devices. > > > > Modified tests by the reasons: > > > > * Mixed BG > > - btrfs/011 > > * Non-single profile > > - btrfs/003 > > - btrfs/011 > > - btrfs/023 > > - btrfs/124 > > - btrfs/125 > > - btrfs/148 > > - btrfs/157 > > - btrfs/158 > > - btrfs/195 > > - btrfs/197 > > - btrfs/198 > > * Convert from ext4 > > - btrfs/012 > > - btrfs/136 > > * nodatacow > > - btrfs/236 > > * inode cache > > - btrfs/049 > > * space cache (v1) > > - btrfs/131 > > * write outside of FS code > > - btrfs/116 > > - btrfs/140 > > - btrfs/215 > > * verbose output > > - btrfs/194 > > > > Signed-off-by: Naohiro Aota <naohiro.aota@xxxxxxx> > > --- > > common/btrfs | 18 ++++++++++++++++++ > > tests/btrfs/003 | 13 +++++++++---- > > tests/btrfs/011 | 21 ++++++++++++--------- > > tests/btrfs/012 | 2 ++ > > tests/btrfs/023 | 2 ++ > > tests/btrfs/049 | 2 ++ > > tests/btrfs/116 | 2 ++ > > tests/btrfs/124 | 4 ++++ > > tests/btrfs/125 | 2 ++ > > tests/btrfs/131 | 2 ++ > > tests/btrfs/136 | 2 ++ > > tests/btrfs/140 | 2 ++ > > tests/btrfs/148 | 2 ++ > > tests/btrfs/157 | 2 ++ > > tests/btrfs/158 | 2 ++ > > tests/btrfs/194 | 2 +- > > tests/btrfs/195 | 8 ++++++++ > > tests/btrfs/197 | 1 + > > tests/btrfs/198 | 1 + > > tests/btrfs/215 | 1 + > > tests/btrfs/236 | 33 ++++++++++++++++++++------------- > > 21 files changed, 97 insertions(+), 27 deletions(-) > > > > diff --git a/common/btrfs b/common/btrfs > > index ebe6ce269a6b..fb1a65842012 100644 > > --- a/common/btrfs > > +++ b/common/btrfs > > @@ -222,6 +222,18 @@ _btrfs_get_profile_configs() > > else > > local unsupported=() > > fi > > + > > + if [ `_zone_type $TEST_DEV` != "none" ]; then > > Better to have some comments in code as well. Sure. I'll add comments for all the places. > > + unsupported+=( > > + "dup" > > + "raid0" > > + "raid1" > > + "raid10" > > + "raid5" > > + "raid6" > > + ) > > + fi > > + > > for unsupp in "${unsupported[@]}"; do > > if [ "${profiles[0]}" == "$unsupp" -o "${profiles[1]}" == "$unsupp" ]; then > > if [ -z "$BTRFS_PROFILE_CONFIGS" ]; then > > @@ -419,3 +431,9 @@ _btrfs_rescan_devices() > > { > > $BTRFS_UTIL_PROG device scan &> /dev/null > > } > > + > > +_scratch_btrfs_is_zoned() > > +{ > > + [ `_zone_type ${SCRATCH_DEV}` != "none" ] && return 0 > > + return 1 > > +} > > diff --git a/tests/btrfs/003 b/tests/btrfs/003 > > index d241ec6e9fdd..af0dc8a7e105 100755 > > --- a/tests/btrfs/003 > > +++ b/tests/btrfs/003 > > @@ -173,12 +173,17 @@ _test_remove() > > _scratch_unmount > > } > > > > -_test_raid0 > > -_test_raid1 > > -_test_raid10 > > +if ! _scratch_btrfs_is_zoned; then > > + _test_raid0 > > + _test_raid1 > > + _test_raid10 > > +fi > > + > > _test_single > > _test_add > > -_test_replace > > +if ! _scratch_btrfs_is_zoned; then > > Same here, some comments to explain why replace doesn't work with zoned > devices? > > > + _test_replace > > +fi > > _test_remove > > > > echo "Silence is golden" > > diff --git a/tests/btrfs/011 b/tests/btrfs/011 > > index f5d865ab3d21..b4673341c24b 100755 > > --- a/tests/btrfs/011 > > +++ b/tests/btrfs/011 > > @@ -226,15 +226,18 @@ btrfs_replace_test() > > } > > > > 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 > > diff --git a/tests/btrfs/012 b/tests/btrfs/012 > > index 46341e984821..3040a655095c 100755 > > --- a/tests/btrfs/012 > > +++ b/tests/btrfs/012 > > @@ -28,6 +28,8 @@ _require_scratch_nocheck > > _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}') > > > > diff --git a/tests/btrfs/023 b/tests/btrfs/023 > > index f6c05b121099..49ca95bc9efb 100755 > > --- a/tests/btrfs/023 > > +++ b/tests/btrfs/023 > > @@ -17,6 +17,8 @@ _begin_fstest auto > > # real QA test starts here > > _supported_fs btrfs > > _require_scratch_dev_pool 4 > > +# RAID profiles are not supported on zoned btrfs > > +_require_non_zoned_device "${SCRATCH_DEV}" > > > > create_group_profile() > > { > > diff --git a/tests/btrfs/049 b/tests/btrfs/049 > > index ad4ef122f3c9..a9cd5b2cf12b 100755 > > --- a/tests/btrfs/049 > > +++ b/tests/btrfs/049 > > @@ -27,6 +27,8 @@ _cleanup() > > _supported_fs btrfs > > _require_scratch > > _require_dm_target flakey > > +# inode cache is not supported on zoned btrfs > > +_require_non_zoned_device "$SCRATCH_DEV" > > > > _scratch_mkfs >> $seqres.full 2>&1 > > > > diff --git a/tests/btrfs/116 b/tests/btrfs/116 > > index 14182e9c0f49..2449e6e3a64d 100755 > > --- a/tests/btrfs/116 > > +++ b/tests/btrfs/116 > > @@ -18,6 +18,8 @@ _begin_fstest auto quick metadata > > # 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 > > > > diff --git a/tests/btrfs/124 b/tests/btrfs/124 > > index 3036cbf4a72c..5c05ffae1b8f 100755 > > --- a/tests/btrfs/124 > > +++ b/tests/btrfs/124 > > @@ -49,6 +49,10 @@ _scratch_dev_pool_get 2 > > 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 > > diff --git a/tests/btrfs/125 b/tests/btrfs/125 > > index e46b194d0139..de6651739f49 100755 > > --- a/tests/btrfs/125 > > +++ b/tests/btrfs/125 > > @@ -43,6 +43,8 @@ _require_scratch_dev_pool 3 > > _test_unmount > > _require_btrfs_forget_or_module_loadable > > _require_btrfs_fs_feature raid56 > > +# raid56 is not supported on zoned btrfs > > +_require_non_zoned_device "${SCRATCH_DEV}" > > I think this check could be folded into "_require_btrfs_fs_feature raid56" Yeah, that will make the patch much more simple. Thanks.