fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 3/2] xfstest: test running growfs on the realtime volume
       [not found] <160212936001.248573.7813264584242634489.stgit@magnolia>
@ 2020-10-08  3:59 ` Darrick J. Wong
  2020-10-08  8:12   ` Chandan Babu R
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2020-10-08  3:59 UTC (permalink / raw)
  To: linux-xfs, chandanrlinux, sandeen; +Cc: fstests

From: Darrick J. Wong <darrick.wong@oracle.com>

Make sure that we can run growfs to expand the realtime volume without
it blowing up.  This is a regression test for the following patches:

xfs: Set xfs_buf type flag when growing summary/bitmap files
xfs: Set xfs_buf's b_ops member when zeroing bitmap/summary files
xfs: fix realtime bitmap/summary file truncation when growing rt volume
xfs: make xfs_growfs_rt update secondary superblocks

Because the xfs maintainer realized that no, we have no tests for this
particular piece of functionality.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 tests/xfs/916     |   81 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/916.out |   10 +++++++
 tests/xfs/group   |    1 +
 3 files changed, 92 insertions(+)
 create mode 100755 tests/xfs/916
 create mode 100644 tests/xfs/916.out

diff --git a/tests/xfs/916 b/tests/xfs/916
new file mode 100755
index 00000000..c2484376
--- /dev/null
+++ b/tests/xfs/916
@@ -0,0 +1,81 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (c) 2020, Oracle and/or its affiliates.  All Rights Reserved.
+#
+# FS QA Test No. 916
+#
+# Tests xfs_growfs on the realtime volume to make sure none of it blows up.
+# This is a regression test for the following patches:
+#
+# xfs: Set xfs_buf type flag when growing summary/bitmap files
+# xfs: Set xfs_buf's b_ops member when zeroing bitmap/summary files
+# xfs: fix realtime bitmap/summary file truncation when growing rt volume
+# xfs: make xfs_growfs_rt update secondary superblocks
+#
+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 /
+	_scratch_unmount >> $seqres.full 2>&1
+	test -e "$rtdev" && losetup -d $rtdev >> $seqres.full 2>&1
+	rm -f $tmp.* $TEST_DIR/$seq.rtvol
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# real QA test starts here
+_supported_fs xfs
+# Note that we don't _require_realtime because we synthesize a rt volume
+# below.
+_require_scratch_nocheck
+_require_no_large_scratch_dev
+
+echo "Create fake rt volume"
+truncate -s 400m $TEST_DIR/$seq.rtvol
+rtdev=$(_create_loop_device $TEST_DIR/$seq.rtvol)
+
+echo "Format and mount 100m rt volume"
+export USE_EXTERNAL=yes
+export SCRATCH_RTDEV=$rtdev
+_scratch_mkfs -r size=100m > $seqres.full
+_scratch_mount || _notrun "Could not mount scratch with synthetic rt volume"
+
+testdir=$SCRATCH_MNT/test-$seq
+mkdir $testdir
+
+echo "Check rt volume stats"
+$XFS_IO_PROG -c 'chattr +t' $testdir
+$XFS_INFO_PROG $SCRATCH_MNT >> $seqres.full
+before=$(stat -f -c '%b' $testdir)
+
+echo "Create some files"
+_pwrite_byte 0x61 0 1m $testdir/original >> $seqres.full
+
+echo "Grow fs"
+$XFS_GROWFS_PROG $SCRATCH_MNT 2>&1 |  _filter_growfs >> $seqres.full
+_scratch_cycle_mount
+
+echo "Recheck 400m rt volume stats"
+$XFS_INFO_PROG $SCRATCH_MNT >> $seqres.full
+after=$(stat -f -c '%b' $testdir)
+_within_tolerance "rt volume size" $after $((before * 4)) 5% -v
+
+echo "Create more copies to make sure the bitmap really works"
+cp -p $testdir/original $testdir/copy3
+
+echo "Check filesystem"
+_check_xfs_filesystem $SCRATCH_DEV none $rtdev
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/916.out b/tests/xfs/916.out
new file mode 100644
index 00000000..55f2356a
--- /dev/null
+++ b/tests/xfs/916.out
@@ -0,0 +1,10 @@
+QA output created by 916
+Create fake rt volume
+Format and mount 100m rt volume
+Check rt volume stats
+Create some files
+Grow fs
+Recheck 400m rt volume stats
+rt volume size is in range
+Create more copies to make sure the bitmap really works
+Check filesystem
diff --git a/tests/xfs/group b/tests/xfs/group
index ef375397..4e58b5cc 100644
--- a/tests/xfs/group
+++ b/tests/xfs/group
@@ -549,6 +549,7 @@
 910 auto quick inobtcount
 911 auto quick bigtime
 915 auto quick quota
+916 auto quick realtime growfs
 1202 auto quick swapext
 1208 auto quick swapext
 1500 dangerous_fuzzers dangerous_bothrepair

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

* Re: [RFC PATCH 3/2] xfstest: test running growfs on the realtime volume
  2020-10-08  3:59 ` [RFC PATCH 3/2] xfstest: test running growfs on the realtime volume Darrick J. Wong
@ 2020-10-08  8:12   ` Chandan Babu R
  2020-10-08 15:02     ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Chandan Babu R @ 2020-10-08  8:12 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: linux-xfs, sandeen, fstests, guaneryu

On Thursday 8 October 2020 9:29:57 AM IST Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Make sure that we can run growfs to expand the realtime volume without
> it blowing up.  This is a regression test for the following patches:
> 
> xfs: Set xfs_buf type flag when growing summary/bitmap files
> xfs: Set xfs_buf's b_ops member when zeroing bitmap/summary files
> xfs: fix realtime bitmap/summary file truncation when growing rt volume
> xfs: make xfs_growfs_rt update secondary superblocks
> 
> Because the xfs maintainer realized that no, we have no tests for this
> particular piece of functionality.

Looks good to me.

Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>

Eryu,
We could ignore https://www.spinics.net/lists/linux-xfs/msg44948.html since
the current patch is a superset of the test scenarios verified there.

> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  tests/xfs/916     |   81 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  tests/xfs/916.out |   10 +++++++
>  tests/xfs/group   |    1 +
>  3 files changed, 92 insertions(+)
>  create mode 100755 tests/xfs/916
>  create mode 100644 tests/xfs/916.out
> 
> diff --git a/tests/xfs/916 b/tests/xfs/916
> new file mode 100755
> index 00000000..c2484376
> --- /dev/null
> +++ b/tests/xfs/916
> @@ -0,0 +1,81 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +# Copyright (c) 2020, Oracle and/or its affiliates.  All Rights Reserved.
> +#
> +# FS QA Test No. 916
> +#
> +# Tests xfs_growfs on the realtime volume to make sure none of it blows up.
> +# This is a regression test for the following patches:
> +#
> +# xfs: Set xfs_buf type flag when growing summary/bitmap files
> +# xfs: Set xfs_buf's b_ops member when zeroing bitmap/summary files
> +# xfs: fix realtime bitmap/summary file truncation when growing rt volume
> +# xfs: make xfs_growfs_rt update secondary superblocks
> +#
> +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 /
> +	_scratch_unmount >> $seqres.full 2>&1
> +	test -e "$rtdev" && losetup -d $rtdev >> $seqres.full 2>&1
> +	rm -f $tmp.* $TEST_DIR/$seq.rtvol
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# real QA test starts here
> +_supported_fs xfs
> +# Note that we don't _require_realtime because we synthesize a rt volume
> +# below.
> +_require_scratch_nocheck
> +_require_no_large_scratch_dev
> +
> +echo "Create fake rt volume"
> +truncate -s 400m $TEST_DIR/$seq.rtvol
> +rtdev=$(_create_loop_device $TEST_DIR/$seq.rtvol)
> +
> +echo "Format and mount 100m rt volume"
> +export USE_EXTERNAL=yes
> +export SCRATCH_RTDEV=$rtdev
> +_scratch_mkfs -r size=100m > $seqres.full
> +_scratch_mount || _notrun "Could not mount scratch with synthetic rt volume"
> +
> +testdir=$SCRATCH_MNT/test-$seq
> +mkdir $testdir
> +
> +echo "Check rt volume stats"
> +$XFS_IO_PROG -c 'chattr +t' $testdir
> +$XFS_INFO_PROG $SCRATCH_MNT >> $seqres.full
> +before=$(stat -f -c '%b' $testdir)
> +
> +echo "Create some files"
> +_pwrite_byte 0x61 0 1m $testdir/original >> $seqres.full
> +
> +echo "Grow fs"
> +$XFS_GROWFS_PROG $SCRATCH_MNT 2>&1 |  _filter_growfs >> $seqres.full
> +_scratch_cycle_mount
> +
> +echo "Recheck 400m rt volume stats"
> +$XFS_INFO_PROG $SCRATCH_MNT >> $seqres.full
> +after=$(stat -f -c '%b' $testdir)
> +_within_tolerance "rt volume size" $after $((before * 4)) 5% -v
> +
> +echo "Create more copies to make sure the bitmap really works"
> +cp -p $testdir/original $testdir/copy3
> +
> +echo "Check filesystem"
> +_check_xfs_filesystem $SCRATCH_DEV none $rtdev
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/tests/xfs/916.out b/tests/xfs/916.out
> new file mode 100644
> index 00000000..55f2356a
> --- /dev/null
> +++ b/tests/xfs/916.out
> @@ -0,0 +1,10 @@
> +QA output created by 916
> +Create fake rt volume
> +Format and mount 100m rt volume
> +Check rt volume stats
> +Create some files
> +Grow fs
> +Recheck 400m rt volume stats
> +rt volume size is in range
> +Create more copies to make sure the bitmap really works
> +Check filesystem
> diff --git a/tests/xfs/group b/tests/xfs/group
> index ef375397..4e58b5cc 100644
> --- a/tests/xfs/group
> +++ b/tests/xfs/group
> @@ -549,6 +549,7 @@
>  910 auto quick inobtcount
>  911 auto quick bigtime
>  915 auto quick quota
> +916 auto quick realtime growfs
>  1202 auto quick swapext
>  1208 auto quick swapext
>  1500 dangerous_fuzzers dangerous_bothrepair
> 


-- 
chandan




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

* Re: [RFC PATCH 3/2] xfstest: test running growfs on the realtime volume
  2020-10-08  8:12   ` Chandan Babu R
@ 2020-10-08 15:02     ` Darrick J. Wong
  0 siblings, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2020-10-08 15:02 UTC (permalink / raw)
  To: Chandan Babu R; +Cc: linux-xfs, sandeen, fstests, guaneryu

On Thu, Oct 08, 2020 at 01:42:47PM +0530, Chandan Babu R wrote:
> On Thursday 8 October 2020 9:29:57 AM IST Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Make sure that we can run growfs to expand the realtime volume without
> > it blowing up.  This is a regression test for the following patches:
> > 
> > xfs: Set xfs_buf type flag when growing summary/bitmap files
> > xfs: Set xfs_buf's b_ops member when zeroing bitmap/summary files
> > xfs: fix realtime bitmap/summary file truncation when growing rt volume
> > xfs: make xfs_growfs_rt update secondary superblocks
> > 
> > Because the xfs maintainer realized that no, we have no tests for this
> > particular piece of functionality.
> 
> Looks good to me.
> 
> Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
> 
> Eryu,
> We could ignore https://www.spinics.net/lists/linux-xfs/msg44948.html since
> the current patch is a superset of the test scenarios verified there.

Ofc now I discover that there's yet another bug in that we don't
annotate grabbing the rt bitmap and summary files, which causes lockdep
to barf, so I'll rev the whole series with that fix and update this test.

--D

> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  tests/xfs/916     |   81 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  tests/xfs/916.out |   10 +++++++
> >  tests/xfs/group   |    1 +
> >  3 files changed, 92 insertions(+)
> >  create mode 100755 tests/xfs/916
> >  create mode 100644 tests/xfs/916.out
> > 
> > diff --git a/tests/xfs/916 b/tests/xfs/916
> > new file mode 100755
> > index 00000000..c2484376
> > --- /dev/null
> > +++ b/tests/xfs/916
> > @@ -0,0 +1,81 @@
> > +#! /bin/bash
> > +# SPDX-License-Identifier: GPL-2.0-or-later
> > +# Copyright (c) 2020, Oracle and/or its affiliates.  All Rights Reserved.
> > +#
> > +# FS QA Test No. 916
> > +#
> > +# Tests xfs_growfs on the realtime volume to make sure none of it blows up.
> > +# This is a regression test for the following patches:
> > +#
> > +# xfs: Set xfs_buf type flag when growing summary/bitmap files
> > +# xfs: Set xfs_buf's b_ops member when zeroing bitmap/summary files
> > +# xfs: fix realtime bitmap/summary file truncation when growing rt volume
> > +# xfs: make xfs_growfs_rt update secondary superblocks
> > +#
> > +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 /
> > +	_scratch_unmount >> $seqres.full 2>&1
> > +	test -e "$rtdev" && losetup -d $rtdev >> $seqres.full 2>&1
> > +	rm -f $tmp.* $TEST_DIR/$seq.rtvol
> > +}
> > +
> > +# get standard environment, filters and checks
> > +. ./common/rc
> > +. ./common/filter
> > +
> > +# real QA test starts here
> > +_supported_fs xfs
> > +# Note that we don't _require_realtime because we synthesize a rt volume
> > +# below.
> > +_require_scratch_nocheck
> > +_require_no_large_scratch_dev
> > +
> > +echo "Create fake rt volume"
> > +truncate -s 400m $TEST_DIR/$seq.rtvol
> > +rtdev=$(_create_loop_device $TEST_DIR/$seq.rtvol)
> > +
> > +echo "Format and mount 100m rt volume"
> > +export USE_EXTERNAL=yes
> > +export SCRATCH_RTDEV=$rtdev
> > +_scratch_mkfs -r size=100m > $seqres.full
> > +_scratch_mount || _notrun "Could not mount scratch with synthetic rt volume"
> > +
> > +testdir=$SCRATCH_MNT/test-$seq
> > +mkdir $testdir
> > +
> > +echo "Check rt volume stats"
> > +$XFS_IO_PROG -c 'chattr +t' $testdir
> > +$XFS_INFO_PROG $SCRATCH_MNT >> $seqres.full
> > +before=$(stat -f -c '%b' $testdir)
> > +
> > +echo "Create some files"
> > +_pwrite_byte 0x61 0 1m $testdir/original >> $seqres.full
> > +
> > +echo "Grow fs"
> > +$XFS_GROWFS_PROG $SCRATCH_MNT 2>&1 |  _filter_growfs >> $seqres.full
> > +_scratch_cycle_mount
> > +
> > +echo "Recheck 400m rt volume stats"
> > +$XFS_INFO_PROG $SCRATCH_MNT >> $seqres.full
> > +after=$(stat -f -c '%b' $testdir)
> > +_within_tolerance "rt volume size" $after $((before * 4)) 5% -v
> > +
> > +echo "Create more copies to make sure the bitmap really works"
> > +cp -p $testdir/original $testdir/copy3
> > +
> > +echo "Check filesystem"
> > +_check_xfs_filesystem $SCRATCH_DEV none $rtdev
> > +
> > +# success, all done
> > +status=0
> > +exit
> > diff --git a/tests/xfs/916.out b/tests/xfs/916.out
> > new file mode 100644
> > index 00000000..55f2356a
> > --- /dev/null
> > +++ b/tests/xfs/916.out
> > @@ -0,0 +1,10 @@
> > +QA output created by 916
> > +Create fake rt volume
> > +Format and mount 100m rt volume
> > +Check rt volume stats
> > +Create some files
> > +Grow fs
> > +Recheck 400m rt volume stats
> > +rt volume size is in range
> > +Create more copies to make sure the bitmap really works
> > +Check filesystem
> > diff --git a/tests/xfs/group b/tests/xfs/group
> > index ef375397..4e58b5cc 100644
> > --- a/tests/xfs/group
> > +++ b/tests/xfs/group
> > @@ -549,6 +549,7 @@
> >  910 auto quick inobtcount
> >  911 auto quick bigtime
> >  915 auto quick quota
> > +916 auto quick realtime growfs
> >  1202 auto quick swapext
> >  1208 auto quick swapext
> >  1500 dangerous_fuzzers dangerous_bothrepair
> > 
> 
> 
> -- 
> chandan
> 
> 
> 

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

end of thread, other threads:[~2020-10-08 15:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <160212936001.248573.7813264584242634489.stgit@magnolia>
2020-10-08  3:59 ` [RFC PATCH 3/2] xfstest: test running growfs on the realtime volume Darrick J. Wong
2020-10-08  8:12   ` Chandan Babu R
2020-10-08 15:02     ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).