FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH v2] xfs: Add test for too-small device with stripe geometry
@ 2020-09-18  6:15 Pavel Reichl
  2020-09-18 15:14 ` Darrick J. Wong
  2020-09-20 16:10 ` Eryu Guan
  0 siblings, 2 replies; 4+ messages in thread
From: Pavel Reichl @ 2020-09-18  6:15 UTC (permalink / raw)
  To: fstests

Verify hat an attempt to create a too-small device with stripe geometry,
is handled gracefully instead of hitting an assert in align_ag_geometry()

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 tests/xfs/260     | 52 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/260.out |  2 ++
 tests/xfs/group   |  1 +
 3 files changed, 55 insertions(+)
 create mode 100755 tests/xfs/260
 create mode 100644 tests/xfs/260.out

diff --git a/tests/xfs/260 b/tests/xfs/260
new file mode 100755
index 00000000..4e81d634
--- /dev/null
+++ b/tests/xfs/260
@@ -0,0 +1,52 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2020 YOUR NAME HERE.  All Rights Reserved.
+#
+# FS QA Test 260
+#
+# Verify that an attempt to create a too-small device with stripe geometry,
+# is handled gracefully instead of hitting an assert in align_ag_geometry()
+#
+# This test verifies the problem fixed in kernel with commit
+# (mkfs.xfs: fix ASSERT on too-small device with stripe geometry)
+#
+
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+	rm -f $localfile
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+echo 'Silence is golden'
+
+_supported_fs xfs
+_supported_os Linux
+_require_test
+
+localfile=$TEST_DIR/260.$$
+
+truncate --size=10444800 $localfile
+
+$MKFS_XFS_PROG -dsu=65536,sw=1 $localfile >> $seqres.full 2>&1
+
+[ $? -ne 1 ] && echo "${MKFS_XFS_PROG} should fail gracefully"
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/260.out b/tests/xfs/260.out
new file mode 100644
index 00000000..18ca517c
--- /dev/null
+++ b/tests/xfs/260.out
@@ -0,0 +1,2 @@
+QA output created by 260
+Silence is golden
diff --git a/tests/xfs/group b/tests/xfs/group
index ed0d389e..7a6dfed7 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -257,6 +257,7 @@
 257 auto quick clone
 258 auto quick clone
 259 auto quick
+260 auto quick mkfs
 261 auto quick quota
 262 dangerous_fuzzers dangerous_scrub dangerous_online_repair
 263 auto quick quota
-- 
2.26.2


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

* Re: [PATCH v2] xfs: Add test for too-small device with stripe geometry
  2020-09-18  6:15 [PATCH v2] xfs: Add test for too-small device with stripe geometry Pavel Reichl
@ 2020-09-18 15:14 ` Darrick J. Wong
  2020-09-20 16:10 ` Eryu Guan
  1 sibling, 0 replies; 4+ messages in thread
From: Darrick J. Wong @ 2020-09-18 15:14 UTC (permalink / raw)
  To: Pavel Reichl; +Cc: fstests

On Fri, Sep 18, 2020 at 08:15:14AM +0200, Pavel Reichl wrote:
> Verify hat an attempt to create a too-small device with stripe geometry,
> is handled gracefully instead of hitting an assert in align_ag_geometry()
> 
> Signed-off-by: Pavel Reichl <preichl@redhat.com>

Looks good to me,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  tests/xfs/260     | 52 +++++++++++++++++++++++++++++++++++++++++++++++
>  tests/xfs/260.out |  2 ++
>  tests/xfs/group   |  1 +
>  3 files changed, 55 insertions(+)
>  create mode 100755 tests/xfs/260
>  create mode 100644 tests/xfs/260.out
> 
> diff --git a/tests/xfs/260 b/tests/xfs/260
> new file mode 100755
> index 00000000..4e81d634
> --- /dev/null
> +++ b/tests/xfs/260
> @@ -0,0 +1,52 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2020 YOUR NAME HERE.  All Rights Reserved.
> +#
> +# FS QA Test 260
> +#
> +# Verify that an attempt to create a too-small device with stripe geometry,
> +# is handled gracefully instead of hitting an assert in align_ag_geometry()
> +#
> +# This test verifies the problem fixed in kernel with commit
> +# (mkfs.xfs: fix ASSERT on too-small device with stripe geometry)
> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +	cd /
> +	rm -f $tmp.*
> +	rm -f $localfile
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +echo 'Silence is golden'
> +
> +_supported_fs xfs
> +_supported_os Linux
> +_require_test
> +
> +localfile=$TEST_DIR/260.$$
> +
> +truncate --size=10444800 $localfile
> +
> +$MKFS_XFS_PROG -dsu=65536,sw=1 $localfile >> $seqres.full 2>&1
> +
> +[ $? -ne 1 ] && echo "${MKFS_XFS_PROG} should fail gracefully"
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/tests/xfs/260.out b/tests/xfs/260.out
> new file mode 100644
> index 00000000..18ca517c
> --- /dev/null
> +++ b/tests/xfs/260.out
> @@ -0,0 +1,2 @@
> +QA output created by 260
> +Silence is golden
> diff --git a/tests/xfs/group b/tests/xfs/group
> index ed0d389e..7a6dfed7 100644
> --- a/tests/xfs/group
> +++ b/tests/xfs/group
> @@ -257,6 +257,7 @@
>  257 auto quick clone
>  258 auto quick clone
>  259 auto quick
> +260 auto quick mkfs
>  261 auto quick quota
>  262 dangerous_fuzzers dangerous_scrub dangerous_online_repair
>  263 auto quick quota
> -- 
> 2.26.2
> 

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

* Re: [PATCH v2] xfs: Add test for too-small device with stripe geometry
  2020-09-18  6:15 [PATCH v2] xfs: Add test for too-small device with stripe geometry Pavel Reichl
  2020-09-18 15:14 ` Darrick J. Wong
@ 2020-09-20 16:10 ` Eryu Guan
  2020-09-21  8:56   ` Pavel Reichl
  1 sibling, 1 reply; 4+ messages in thread
From: Eryu Guan @ 2020-09-20 16:10 UTC (permalink / raw)
  To: Pavel Reichl; +Cc: fstests

On Fri, Sep 18, 2020 at 08:15:14AM +0200, Pavel Reichl wrote:
> Verify hat an attempt to create a too-small device with stripe geometry,
> is handled gracefully instead of hitting an assert in align_ag_geometry()
> 
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
>  tests/xfs/260     | 52 +++++++++++++++++++++++++++++++++++++++++++++++
>  tests/xfs/260.out |  2 ++
>  tests/xfs/group   |  1 +
>  3 files changed, 55 insertions(+)
>  create mode 100755 tests/xfs/260
>  create mode 100644 tests/xfs/260.out
> 
> diff --git a/tests/xfs/260 b/tests/xfs/260
> new file mode 100755
> index 00000000..4e81d634
> --- /dev/null
> +++ b/tests/xfs/260
> @@ -0,0 +1,52 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2020 YOUR NAME HERE.  All Rights Reserved.
                        ^^^^^^^^^^^^^^^
Please update copyright.

> +#
> +# FS QA Test 260
> +#
> +# Verify that an attempt to create a too-small device with stripe geometry,
> +# is handled gracefully instead of hitting an assert in align_ag_geometry()
> +#
> +# This test verifies the problem fixed in kernel with commit
> +# (mkfs.xfs: fix ASSERT on too-small device with stripe geometry)

This looks like an xfsprogs patch, instead of a kernel patch.

> +#
> +
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +	cd /
> +	rm -f $tmp.*
> +	rm -f $localfile
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +echo 'Silence is golden'
> +
> +_supported_fs xfs
> +_supported_os Linux
> +_require_test
> +
> +localfile=$TEST_DIR/260.$$

Instead of hardcoding it, 260 could be replaced by $seq

> +
> +truncate --size=10444800 $localfile

$XFS_IO -c "truncate 10444800" $localfile

Historically, truncate(1) is not recommended as some (very old) distros
don't have it (e.g. RHEL5), though most mordern distros (if not all)
should have it installed, we'd keep things consistent and perfer the
xfs_io way.

Thanks,
Eryu

> +
> +$MKFS_XFS_PROG -dsu=65536,sw=1 $localfile >> $seqres.full 2>&1
> +
> +[ $? -ne 1 ] && echo "${MKFS_XFS_PROG} should fail gracefully"
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/tests/xfs/260.out b/tests/xfs/260.out
> new file mode 100644
> index 00000000..18ca517c
> --- /dev/null
> +++ b/tests/xfs/260.out
> @@ -0,0 +1,2 @@
> +QA output created by 260
> +Silence is golden
> diff --git a/tests/xfs/group b/tests/xfs/group
> index ed0d389e..7a6dfed7 100644
> --- a/tests/xfs/group
> +++ b/tests/xfs/group
> @@ -257,6 +257,7 @@
>  257 auto quick clone
>  258 auto quick clone
>  259 auto quick
> +260 auto quick mkfs
>  261 auto quick quota
>  262 dangerous_fuzzers dangerous_scrub dangerous_online_repair
>  263 auto quick quota
> -- 
> 2.26.2

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

* Re: [PATCH v2] xfs: Add test for too-small device with stripe geometry
  2020-09-20 16:10 ` Eryu Guan
@ 2020-09-21  8:56   ` Pavel Reichl
  0 siblings, 0 replies; 4+ messages in thread
From: Pavel Reichl @ 2020-09-21  8:56 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests

Thanks for the comments I hope I have addressed them all in version 3. Bye.


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

end of thread, other threads:[~2020-09-21  8:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-18  6:15 [PATCH v2] xfs: Add test for too-small device with stripe geometry Pavel Reichl
2020-09-18 15:14 ` Darrick J. Wong
2020-09-20 16:10 ` Eryu Guan
2020-09-21  8:56   ` Pavel Reichl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox