diff mbox series

[v2,8/8] fstests: generic: add checks for zoned block device

Message ID 20210811151232.3713733-9-naohiro.aota@wdc.com (mailing list archive)
State New, archived
Headers show
Series fstests: add checks for testing zoned btrfs | expand

Commit Message

Naohiro Aota Aug. 11, 2021, 3:12 p.m. UTC
Modify generic tests to require non-zoned block device

generic/108 is disabled on zoned block device because the LVM device not
always aligned to the zone boundary.

generic/471 is disabled because we cannot enable NoCoW on zoned btrfs.

generic/570 is disabled because swap file which require nocow is not usable
on zoned btrfs.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 tests/generic/108 | 1 +
 tests/generic/471 | 1 +
 tests/generic/570 | 1 +
 3 files changed, 3 insertions(+)

Comments

Eryu Guan Aug. 15, 2021, 3:20 p.m. UTC | #1
On Thu, Aug 12, 2021 at 12:12:32AM +0900, Naohiro Aota wrote:
> Modify generic tests to require non-zoned block device
> 
> generic/108 is disabled on zoned block device because the LVM device not
> always aligned to the zone boundary.
> 
> generic/471 is disabled because we cannot enable NoCoW on zoned btrfs.
> 
> generic/570 is disabled because swap file which require nocow is not usable
> on zoned btrfs.
> 
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> ---
>  tests/generic/108 | 1 +
>  tests/generic/471 | 1 +
>  tests/generic/570 | 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/tests/generic/108 b/tests/generic/108
> index 7dd426c19030..b51bce9f9bce 100755
> --- a/tests/generic/108
> +++ b/tests/generic/108
> @@ -35,6 +35,7 @@ _require_scratch_nocheck
>  _require_block_device $SCRATCH_DEV
>  _require_scsi_debug
>  _require_command "$LVM_PROG" lvm
> +_require_non_zoned_device $SCRATCH_DEV

I think in generic/108 and generic/570 we should only check zoned device
if FSTYP is btrfs in in generic/471. And also need comments to explain
the reason to do so.

Thanks,
Eryu

>  
>  lvname=lv_$seq
>  vgname=vg_$seq
> diff --git a/tests/generic/471 b/tests/generic/471
> index dab06f3a315c..66b7d6946a9f 100755
> --- a/tests/generic/471
> +++ b/tests/generic/471
> @@ -37,6 +37,7 @@ mkdir $testdir
>  # all filesystems, use a NOCOW file on btrfs.
>  if [ $FSTYP == "btrfs" ]; then
>  	_require_chattr C
> +	_require_non_zoned_device $TEST_DEV
>  	touch $testdir/f1
>  	$CHATTR_PROG +C $testdir/f1
>  fi
> diff --git a/tests/generic/570 b/tests/generic/570
> index 7d03acfe3c44..71928f0ac980 100755
> --- a/tests/generic/570
> +++ b/tests/generic/570
> @@ -25,6 +25,7 @@ _supported_fs generic
>  _require_test_program swapon
>  _require_scratch_nocheck
>  _require_block_device $SCRATCH_DEV
> +_require_non_zoned_device "$SCRATCH_DEV"
>  test -e /dev/snapshot && _notrun "userspace hibernation to swap is enabled"
>  
>  $MKSWAP_PROG "$SCRATCH_DEV" >> $seqres.full
> -- 
> 2.32.0
Naohiro Aota Aug. 16, 2021, 6:19 a.m. UTC | #2
On Sun, Aug 15, 2021 at 11:20:07PM +0800, Eryu Guan wrote:
> On Thu, Aug 12, 2021 at 12:12:32AM +0900, Naohiro Aota wrote:
> > Modify generic tests to require non-zoned block device
> > 
> > generic/108 is disabled on zoned block device because the LVM device not
> > always aligned to the zone boundary.
> > 
> > generic/471 is disabled because we cannot enable NoCoW on zoned btrfs.
> > 
> > generic/570 is disabled because swap file which require nocow is not usable
> > on zoned btrfs.
> > 
> > Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> > ---
> >  tests/generic/108 | 1 +
> >  tests/generic/471 | 1 +
> >  tests/generic/570 | 1 +
> >  3 files changed, 3 insertions(+)
> > 
> > diff --git a/tests/generic/108 b/tests/generic/108
> > index 7dd426c19030..b51bce9f9bce 100755
> > --- a/tests/generic/108
> > +++ b/tests/generic/108
> > @@ -35,6 +35,7 @@ _require_scratch_nocheck
> >  _require_block_device $SCRATCH_DEV
> >  _require_scsi_debug
> >  _require_command "$LVM_PROG" lvm
> > +_require_non_zoned_device $SCRATCH_DEV
> 
> I think in generic/108 and generic/570 we should only check zoned device
> if FSTYP is btrfs in in generic/471. And also need comments to explain
> the reason to do so.

Hmm, I don't think the FSTYP restriction is neccesary for generic/108
and generic/570.

Generic/108 won't work on zoned devices regardless of file system
type, because it tries to create LVM on SCRATCH_DEV.

Also, generic/570 tries to create swap directly on SCRATCH_DEV. So, no
file system code is related here. And, swap cannot be work on zoned
devices, because it will do random write IOs. My commit log was
misleading on this point.

I'll add comments anyway.

> Thanks,
> Eryu
> 
> >  
> >  lvname=lv_$seq
> >  vgname=vg_$seq
> > diff --git a/tests/generic/471 b/tests/generic/471
> > index dab06f3a315c..66b7d6946a9f 100755
> > --- a/tests/generic/471
> > +++ b/tests/generic/471
> > @@ -37,6 +37,7 @@ mkdir $testdir
> >  # all filesystems, use a NOCOW file on btrfs.
> >  if [ $FSTYP == "btrfs" ]; then
> >  	_require_chattr C
> > +	_require_non_zoned_device $TEST_DEV
> >  	touch $testdir/f1
> >  	$CHATTR_PROG +C $testdir/f1
> >  fi
> > diff --git a/tests/generic/570 b/tests/generic/570
> > index 7d03acfe3c44..71928f0ac980 100755
> > --- a/tests/generic/570
> > +++ b/tests/generic/570
> > @@ -25,6 +25,7 @@ _supported_fs generic
> >  _require_test_program swapon
> >  _require_scratch_nocheck
> >  _require_block_device $SCRATCH_DEV
> > +_require_non_zoned_device "$SCRATCH_DEV"
> >  test -e /dev/snapshot && _notrun "userspace hibernation to swap is enabled"
> >  
> >  $MKSWAP_PROG "$SCRATCH_DEV" >> $seqres.full
> > -- 
> > 2.32.0
diff mbox series

Patch

diff --git a/tests/generic/108 b/tests/generic/108
index 7dd426c19030..b51bce9f9bce 100755
--- a/tests/generic/108
+++ b/tests/generic/108
@@ -35,6 +35,7 @@  _require_scratch_nocheck
 _require_block_device $SCRATCH_DEV
 _require_scsi_debug
 _require_command "$LVM_PROG" lvm
+_require_non_zoned_device $SCRATCH_DEV
 
 lvname=lv_$seq
 vgname=vg_$seq
diff --git a/tests/generic/471 b/tests/generic/471
index dab06f3a315c..66b7d6946a9f 100755
--- a/tests/generic/471
+++ b/tests/generic/471
@@ -37,6 +37,7 @@  mkdir $testdir
 # all filesystems, use a NOCOW file on btrfs.
 if [ $FSTYP == "btrfs" ]; then
 	_require_chattr C
+	_require_non_zoned_device $TEST_DEV
 	touch $testdir/f1
 	$CHATTR_PROG +C $testdir/f1
 fi
diff --git a/tests/generic/570 b/tests/generic/570
index 7d03acfe3c44..71928f0ac980 100755
--- a/tests/generic/570
+++ b/tests/generic/570
@@ -25,6 +25,7 @@  _supported_fs generic
 _require_test_program swapon
 _require_scratch_nocheck
 _require_block_device $SCRATCH_DEV
+_require_non_zoned_device "$SCRATCH_DEV"
 test -e /dev/snapshot && _notrun "userspace hibernation to swap is enabled"
 
 $MKSWAP_PROG "$SCRATCH_DEV" >> $seqres.full