All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] fstests: Improve tmpfs handling
@ 2021-04-26 20:50 Jan Kara
  2021-04-26 20:50 ` [PATCH 1/2] common: Fix recovery tests for tmpfs Jan Kara
  2021-04-26 20:50 ` [PATCH 2/2] Don't run tests that require block devices for virtual filesystems Jan Kara
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Kara @ 2021-04-26 20:50 UTC (permalink / raw)
  To: fstests; +Cc: Jan Kara

Hello,

when testing tmpfs with fstests, I've noticed a couple of fstests failures
which are bugs in tests (usually expecting functionality tmpfs does not
provide). The following two patches fix them.

								Honza

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] common: Fix recovery tests for tmpfs
  2021-04-26 20:50 [PATCH 0/2] fstests: Improve tmpfs handling Jan Kara
@ 2021-04-26 20:50 ` Jan Kara
  2021-04-26 20:50 ` [PATCH 2/2] Don't run tests that require block devices for virtual filesystems Jan Kara
  1 sibling, 0 replies; 5+ messages in thread
From: Jan Kara @ 2021-04-26 20:50 UTC (permalink / raw)
  To: fstests; +Cc: Jan Kara

Tmpfs doesn't support metadata journalling. Recognize it as such.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/rc b/common/rc
index 11ff7635700b..2dd1b8ad9e35 100644
--- a/common/rc
+++ b/common/rc
@@ -3441,7 +3441,7 @@ _has_metadata_journaling()
 	fi
 
 	case "$FSTYP" in
-	ext2|vfat|msdos|udf|exfat)
+	ext2|vfat|msdos|udf|exfat|tmpfs)
 		echo "$FSTYP does not support metadata journaling"
 		return 1
 		;;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] Don't run tests that require block devices for virtual filesystems
  2021-04-26 20:50 [PATCH 0/2] fstests: Improve tmpfs handling Jan Kara
  2021-04-26 20:50 ` [PATCH 1/2] common: Fix recovery tests for tmpfs Jan Kara
@ 2021-04-26 20:50 ` Jan Kara
  2021-04-27  6:43   ` Amir Goldstein
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Kara @ 2021-04-26 20:50 UTC (permalink / raw)
  To: fstests; +Cc: Jan Kara

Some tests require block device based filesystems (e.g. because they
setup dm device in a particular way). These tests then fail for tmpfs in
unusual ways (usually trying to call mkfs.tmpfs). Annotate these tests
as requiring block device based filesystem so that we gracefully exit
with _notrun. Also there's no point in simulating successful _mkfs_dev
for such filesystems since the test is unlikely to test anything
sensible. So delete that workaround from _mkfs_dev.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 common/rc         | 28 +++++++++++++---------------
 tests/generic/081 |  2 +-
 tests/generic/347 |  2 +-
 tests/generic/459 |  2 +-
 tests/generic/470 |  2 +-
 tests/generic/500 |  2 +-
 tests/generic/563 |  2 +-
 tests/generic/620 |  2 +-
 8 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/common/rc b/common/rc
index 2dd1b8ad9e35..aa51ccea0be2 100644
--- a/common/rc
+++ b/common/rc
@@ -677,21 +677,6 @@ _mkfs_dev()
 {
     local tmp=`mktemp -u`
     case $FSTYP in
-    nfs*)
-	# do nothing for nfs
-	;;
-    9p)
-	# do nothing for 9p
-	;;
-    virtiofs)
-	# do nothing for virtiofs
-	;;
-    overlay)
-	# do nothing for overlay
-	;;
-    pvfs2)
-	# do nothing for pvfs2
-	;;
     udf)
         $MKFS_UDF_PROG $MKFS_OPTIONS $* 2>$tmp.mkfserr 1>$tmp.mkfsstd
 	;;
@@ -1469,6 +1454,19 @@ _supported_fs()
 	then
 	    return
 	fi
+	if [ "$f" = "blkdev" ]
+	then
+	    case $FSTYP in
+	    nfs*)
+	    9p)
+	    virtiofs)
+	    overlay)
+	    pvfs2)
+	    tmpfs)
+		break
+		;;
+	    esac
+	fi
     done
 
     _notrun "not suitable for this filesystem type: $FSTYP"
diff --git a/tests/generic/081 b/tests/generic/081
index 5dff079852d3..3800a8cf9ef3 100755
--- a/tests/generic/081
+++ b/tests/generic/081
@@ -49,7 +49,7 @@ _cleanup()
 . ./common/filter
 
 # real QA test starts here
-_supported_fs generic
+_supported_fs blkdev
 _require_test
 _require_scratch_nocheck
 _require_dm_target snapshot
diff --git a/tests/generic/347 b/tests/generic/347
index cbc5150a3e54..693f2f8d5ec3 100755
--- a/tests/generic/347
+++ b/tests/generic/347
@@ -56,7 +56,7 @@ _workout()
 . ./common/rc
 . ./common/dmthin
 
-_supported_fs generic
+_supported_fs blkdev
 _require_scratch_nocheck
 _require_dm_target thin-pool
 
diff --git a/tests/generic/459 b/tests/generic/459
index a0b1507c28e4..6b37a4f2f056 100755
--- a/tests/generic/459
+++ b/tests/generic/459
@@ -43,7 +43,7 @@ _cleanup()
 
 # This tests for filesystem lockup not consistency, so don't check for fs
 # consistency after test
-_supported_fs generic
+_supported_fs blkdev
 _require_scratch_nocheck
 _require_dm_target thin-pool
 _require_dm_target snapshot
diff --git a/tests/generic/470 b/tests/generic/470
index d925affe60cf..36d047edf1c0 100755
--- a/tests/generic/470
+++ b/tests/generic/470
@@ -34,7 +34,7 @@ _cleanup()
 rm -f $seqres.full
 
 # real QA test starts here
-_supported_fs generic
+_supported_fs blkdev
 _require_scratch_nocheck
 _require_log_writes_dax_mountopt "dax"
 _require_dm_target thin-pool
diff --git a/tests/generic/500 b/tests/generic/500
index 085ddbf3d906..11599e786c41 100755
--- a/tests/generic/500
+++ b/tests/generic/500
@@ -44,7 +44,7 @@ _cleanup()
 rm -f $seqres.full
 
 # real QA test starts here
-_supported_fs generic
+_supported_fs blkdev
 _require_scratch_nocheck
 _require_dm_target thin-pool
 
diff --git a/tests/generic/563 b/tests/generic/563
index fe7394c0910c..c0cf9e9e7c97 100755
--- a/tests/generic/563
+++ b/tests/generic/563
@@ -41,7 +41,7 @@ rm -f $seqres.full
 # real QA test starts here
 
 # Modify as appropriate.
-_supported_fs generic
+_supported_fs blkdev
 _require_scratch_nocheck
 _require_cgroup2 io
 _require_loop
diff --git a/tests/generic/620 b/tests/generic/620
index 605594419d6c..6c80849f6457 100755
--- a/tests/generic/620
+++ b/tests/generic/620
@@ -40,7 +40,7 @@ _cleanup()
 rm -f $seqres.full
 
 # Modify as appropriate.
-_supported_fs generic
+_supported_fs blkdev
 _require_scratch_size_nocheck $((4 * 1024 * 1024)) #kB
 _require_scratch_16T_support
 _require_dmhugedisk
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] Don't run tests that require block devices for virtual filesystems
  2021-04-26 20:50 ` [PATCH 2/2] Don't run tests that require block devices for virtual filesystems Jan Kara
@ 2021-04-27  6:43   ` Amir Goldstein
  2021-04-27  8:49     ` Jan Kara
  0 siblings, 1 reply; 5+ messages in thread
From: Amir Goldstein @ 2021-04-27  6:43 UTC (permalink / raw)
  To: Jan Kara; +Cc: fstests

On Mon, Apr 26, 2021 at 11:50 PM Jan Kara <jack@suse.cz> wrote:
>
> Some tests require block device based filesystems (e.g. because they
> setup dm device in a particular way). These tests then fail for tmpfs in

I don't understand. _require_dm_target has:

        # require SCRATCH_DEV to be a valid block device with sane BLKFLSBUF
        # behaviour
        _require_block_device $SCRATCH_DEV
        _require_sane_bdev_flush $SCRATCH_DEV

and generic/563 has explicit _require_block_device

Why does tmpfs pass these checks?

> unusual ways (usually trying to call mkfs.tmpfs). Annotate these tests
> as requiring block device based filesystem so that we gracefully exit
> with _notrun. Also there's no point in simulating successful _mkfs_dev
> for such filesystems since the test is unlikely to test anything
> sensible. So delete that workaround from _mkfs_dev.
>
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  common/rc         | 28 +++++++++++++---------------
>  tests/generic/081 |  2 +-
>  tests/generic/347 |  2 +-
>  tests/generic/459 |  2 +-
>  tests/generic/470 |  2 +-
>  tests/generic/500 |  2 +-
>  tests/generic/563 |  2 +-
>  tests/generic/620 |  2 +-
>  8 files changed, 20 insertions(+), 22 deletions(-)
>
> diff --git a/common/rc b/common/rc
> index 2dd1b8ad9e35..aa51ccea0be2 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -677,21 +677,6 @@ _mkfs_dev()
>  {
>      local tmp=`mktemp -u`
>      case $FSTYP in
> -    nfs*)
> -       # do nothing for nfs
> -       ;;
> -    9p)
> -       # do nothing for 9p
> -       ;;
> -    virtiofs)
> -       # do nothing for virtiofs
> -       ;;
> -    overlay)
> -       # do nothing for overlay
> -       ;;
> -    pvfs2)
> -       # do nothing for pvfs2
> -       ;;
>      udf)
>          $MKFS_UDF_PROG $MKFS_OPTIONS $* 2>$tmp.mkfserr 1>$tmp.mkfsstd
>         ;;
> @@ -1469,6 +1454,19 @@ _supported_fs()
>         then
>             return
>         fi
> +       if [ "$f" = "blkdev" ]
> +       then
> +           case $FSTYP in
> +           nfs*)
> +           9p)
> +           virtiofs)
> +           overlay)
> +           pvfs2)
> +           tmpfs)
> +               break
> +               ;;
> +           esac
> +       fi
>      done
>
>      _notrun "not suitable for this filesystem type: $FSTYP"
> diff --git a/tests/generic/081 b/tests/generic/081
> index 5dff079852d3..3800a8cf9ef3 100755
> --- a/tests/generic/081
> +++ b/tests/generic/081
> @@ -49,7 +49,7 @@ _cleanup()
>  . ./common/filter
>
>  # real QA test starts here
> -_supported_fs generic
> +_supported_fs blkdev
>  _require_test
>  _require_scratch_nocheck
>  _require_dm_target snapshot
> diff --git a/tests/generic/347 b/tests/generic/347
> index cbc5150a3e54..693f2f8d5ec3 100755
> --- a/tests/generic/347
> +++ b/tests/generic/347
> @@ -56,7 +56,7 @@ _workout()
>  . ./common/rc
>  . ./common/dmthin
>
> -_supported_fs generic
> +_supported_fs blkdev
>  _require_scratch_nocheck
>  _require_dm_target thin-pool
>
> diff --git a/tests/generic/459 b/tests/generic/459
> index a0b1507c28e4..6b37a4f2f056 100755
> --- a/tests/generic/459
> +++ b/tests/generic/459
> @@ -43,7 +43,7 @@ _cleanup()
>
>  # This tests for filesystem lockup not consistency, so don't check for fs
>  # consistency after test
> -_supported_fs generic
> +_supported_fs blkdev
>  _require_scratch_nocheck
>  _require_dm_target thin-pool
>  _require_dm_target snapshot
> diff --git a/tests/generic/470 b/tests/generic/470
> index d925affe60cf..36d047edf1c0 100755
> --- a/tests/generic/470
> +++ b/tests/generic/470
> @@ -34,7 +34,7 @@ _cleanup()
>  rm -f $seqres.full
>
>  # real QA test starts here
> -_supported_fs generic
> +_supported_fs blkdev
>  _require_scratch_nocheck
>  _require_log_writes_dax_mountopt "dax"
>  _require_dm_target thin-pool
> diff --git a/tests/generic/500 b/tests/generic/500
> index 085ddbf3d906..11599e786c41 100755
> --- a/tests/generic/500
> +++ b/tests/generic/500
> @@ -44,7 +44,7 @@ _cleanup()
>  rm -f $seqres.full
>
>  # real QA test starts here
> -_supported_fs generic
> +_supported_fs blkdev
>  _require_scratch_nocheck
>  _require_dm_target thin-pool
>
> diff --git a/tests/generic/563 b/tests/generic/563
> index fe7394c0910c..c0cf9e9e7c97 100755
> --- a/tests/generic/563
> +++ b/tests/generic/563
> @@ -41,7 +41,7 @@ rm -f $seqres.full
>  # real QA test starts here
>
>  # Modify as appropriate.
> -_supported_fs generic
> +_supported_fs blkdev
>  _require_scratch_nocheck
>  _require_cgroup2 io
>  _require_loop
> diff --git a/tests/generic/620 b/tests/generic/620
> index 605594419d6c..6c80849f6457 100755
> --- a/tests/generic/620
> +++ b/tests/generic/620
> @@ -40,7 +40,7 @@ _cleanup()
>  rm -f $seqres.full
>
>  # Modify as appropriate.
> -_supported_fs generic
> +_supported_fs blkdev
>  _require_scratch_size_nocheck $((4 * 1024 * 1024)) #kB
>  _require_scratch_16T_support
>  _require_dmhugedisk
> --
> 2.26.2
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] Don't run tests that require block devices for virtual filesystems
  2021-04-27  6:43   ` Amir Goldstein
@ 2021-04-27  8:49     ` Jan Kara
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kara @ 2021-04-27  8:49 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: Jan Kara, fstests

On Tue 27-04-21 09:43:54, Amir Goldstein wrote:
> On Mon, Apr 26, 2021 at 11:50 PM Jan Kara <jack@suse.cz> wrote:
> >
> > Some tests require block device based filesystems (e.g. because they
> > setup dm device in a particular way). These tests then fail for tmpfs in
> 
> I don't understand. _require_dm_target has:
> 
>         # require SCRATCH_DEV to be a valid block device with sane BLKFLSBUF
>         # behaviour
>         _require_block_device $SCRATCH_DEV
>         _require_sane_bdev_flush $SCRATCH_DEV
> 
> and generic/563 has explicit _require_block_device
> 
> Why does tmpfs pass these checks?

Good question. I had accidentally defined valid SCRATCH_DEV from the
previous test. tmpfs didn't use it but it was enough to make tests like
these pass.

								Honza

> 
> > unusual ways (usually trying to call mkfs.tmpfs). Annotate these tests
> > as requiring block device based filesystem so that we gracefully exit
> > with _notrun. Also there's no point in simulating successful _mkfs_dev
> > for such filesystems since the test is unlikely to test anything
> > sensible. So delete that workaround from _mkfs_dev.
> >
> > Signed-off-by: Jan Kara <jack@suse.cz>
> > ---
> >  common/rc         | 28 +++++++++++++---------------
> >  tests/generic/081 |  2 +-
> >  tests/generic/347 |  2 +-
> >  tests/generic/459 |  2 +-
> >  tests/generic/470 |  2 +-
> >  tests/generic/500 |  2 +-
> >  tests/generic/563 |  2 +-
> >  tests/generic/620 |  2 +-
> >  8 files changed, 20 insertions(+), 22 deletions(-)
> >
> > diff --git a/common/rc b/common/rc
> > index 2dd1b8ad9e35..aa51ccea0be2 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -677,21 +677,6 @@ _mkfs_dev()
> >  {
> >      local tmp=`mktemp -u`
> >      case $FSTYP in
> > -    nfs*)
> > -       # do nothing for nfs
> > -       ;;
> > -    9p)
> > -       # do nothing for 9p
> > -       ;;
> > -    virtiofs)
> > -       # do nothing for virtiofs
> > -       ;;
> > -    overlay)
> > -       # do nothing for overlay
> > -       ;;
> > -    pvfs2)
> > -       # do nothing for pvfs2
> > -       ;;
> >      udf)
> >          $MKFS_UDF_PROG $MKFS_OPTIONS $* 2>$tmp.mkfserr 1>$tmp.mkfsstd
> >         ;;
> > @@ -1469,6 +1454,19 @@ _supported_fs()
> >         then
> >             return
> >         fi
> > +       if [ "$f" = "blkdev" ]
> > +       then
> > +           case $FSTYP in
> > +           nfs*)
> > +           9p)
> > +           virtiofs)
> > +           overlay)
> > +           pvfs2)
> > +           tmpfs)
> > +               break
> > +               ;;
> > +           esac
> > +       fi
> >      done
> >
> >      _notrun "not suitable for this filesystem type: $FSTYP"
> > diff --git a/tests/generic/081 b/tests/generic/081
> > index 5dff079852d3..3800a8cf9ef3 100755
> > --- a/tests/generic/081
> > +++ b/tests/generic/081
> > @@ -49,7 +49,7 @@ _cleanup()
> >  . ./common/filter
> >
> >  # real QA test starts here
> > -_supported_fs generic
> > +_supported_fs blkdev
> >  _require_test
> >  _require_scratch_nocheck
> >  _require_dm_target snapshot
> > diff --git a/tests/generic/347 b/tests/generic/347
> > index cbc5150a3e54..693f2f8d5ec3 100755
> > --- a/tests/generic/347
> > +++ b/tests/generic/347
> > @@ -56,7 +56,7 @@ _workout()
> >  . ./common/rc
> >  . ./common/dmthin
> >
> > -_supported_fs generic
> > +_supported_fs blkdev
> >  _require_scratch_nocheck
> >  _require_dm_target thin-pool
> >
> > diff --git a/tests/generic/459 b/tests/generic/459
> > index a0b1507c28e4..6b37a4f2f056 100755
> > --- a/tests/generic/459
> > +++ b/tests/generic/459
> > @@ -43,7 +43,7 @@ _cleanup()
> >
> >  # This tests for filesystem lockup not consistency, so don't check for fs
> >  # consistency after test
> > -_supported_fs generic
> > +_supported_fs blkdev
> >  _require_scratch_nocheck
> >  _require_dm_target thin-pool
> >  _require_dm_target snapshot
> > diff --git a/tests/generic/470 b/tests/generic/470
> > index d925affe60cf..36d047edf1c0 100755
> > --- a/tests/generic/470
> > +++ b/tests/generic/470
> > @@ -34,7 +34,7 @@ _cleanup()
> >  rm -f $seqres.full
> >
> >  # real QA test starts here
> > -_supported_fs generic
> > +_supported_fs blkdev
> >  _require_scratch_nocheck
> >  _require_log_writes_dax_mountopt "dax"
> >  _require_dm_target thin-pool
> > diff --git a/tests/generic/500 b/tests/generic/500
> > index 085ddbf3d906..11599e786c41 100755
> > --- a/tests/generic/500
> > +++ b/tests/generic/500
> > @@ -44,7 +44,7 @@ _cleanup()
> >  rm -f $seqres.full
> >
> >  # real QA test starts here
> > -_supported_fs generic
> > +_supported_fs blkdev
> >  _require_scratch_nocheck
> >  _require_dm_target thin-pool
> >
> > diff --git a/tests/generic/563 b/tests/generic/563
> > index fe7394c0910c..c0cf9e9e7c97 100755
> > --- a/tests/generic/563
> > +++ b/tests/generic/563
> > @@ -41,7 +41,7 @@ rm -f $seqres.full
> >  # real QA test starts here
> >
> >  # Modify as appropriate.
> > -_supported_fs generic
> > +_supported_fs blkdev
> >  _require_scratch_nocheck
> >  _require_cgroup2 io
> >  _require_loop
> > diff --git a/tests/generic/620 b/tests/generic/620
> > index 605594419d6c..6c80849f6457 100755
> > --- a/tests/generic/620
> > +++ b/tests/generic/620
> > @@ -40,7 +40,7 @@ _cleanup()
> >  rm -f $seqres.full
> >
> >  # Modify as appropriate.
> > -_supported_fs generic
> > +_supported_fs blkdev
> >  _require_scratch_size_nocheck $((4 * 1024 * 1024)) #kB
> >  _require_scratch_16T_support
> >  _require_dmhugedisk
> > --
> > 2.26.2
> >
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-27  8:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-26 20:50 [PATCH 0/2] fstests: Improve tmpfs handling Jan Kara
2021-04-26 20:50 ` [PATCH 1/2] common: Fix recovery tests for tmpfs Jan Kara
2021-04-26 20:50 ` [PATCH 2/2] Don't run tests that require block devices for virtual filesystems Jan Kara
2021-04-27  6:43   ` Amir Goldstein
2021-04-27  8:49     ` Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.