]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs: add a zoned growfs test
authorChristoph Hellwig <hch@lst.de>
Wed, 23 Oct 2024 11:33:10 +0000 (13:33 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 5 Nov 2024 08:32:03 +0000 (09:32 +0100)
Zoned file systems require zone aligned RT volume sizes.  Because of
that xfs/596 won't work as-is.  Copy it and test two zone capacity
aligned values.

Signed-off-by: Christoph Hellwig <hch@lst.de>
tests/xfs/4202
tests/xfs/4202.out

index 090d75aeea04b8874d902f846de49905a6596e38..147d95ed019565663c197f4e5afac3f356ef248e 100755 (executable)
@@ -1,32 +1,80 @@
 #! /bin/bash
 # SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2024 Christoph Hellwig.
+# Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+# Copyright (c) Christoph Hellwig
 #
 # FS QA Test No. 4202
 #
-# Regression test for xfs_repair messing up the per-zone used counter.
+# growfs QA tests - repeatedly fill/grow the rt volume of the filesystem check
+# the filesystem contents after each operation.  This is the zoned equivalent of
+# xfs/596
 #
-
 . ./common/preamble
-_begin_fstest auto quick zone repair
+_begin_fstest growfs ioctl auto zone
+
+_cleanup()
+{
+       cd /
+       _scratch_unmount
+       rm -f $tmp.*
+}
+
+. ./common/filter
+. ./common/zoned
+
 
 _require_scratch
-_require_odirect
+_require_realtime
+_require_no_large_scratch_dev
+_require_zoned_device $SCRATCH_RTDEV
 
-_scratch_mkfs >> $seqres.full 2>&1
-_scratch_mount
+zone_capacity=$(_zone_capacity 0 $SCRATCH_RTDEV)
 
-dd if=/dev/zero of=$SCRATCH_MNT/test1 oflag=direct bs=1M count=64
+_fill()
+{
+    if [ $# -ne 1 ]; then echo "Usage: _fill \"path\"" 1>&2 ; exit 1; fi
+    _do "Fill filesystem" \
+       "$here/src/fill2fs --verbose --dir=$1 --seed=0 --filesize=65536 --stddev=32768 --list=- >>$tmp.manifest"
+}
 
-_scratch_unmount
+_do_die_on_error=message_only
+rtsize=$zone_capacity
+echo -n "Make rt filesystem on SCRATCH_DEV and mount... "
+_scratch_mkfs_xfs -r size=${rtsize} | \
+       _filter_mkfs 2> "$tmp.mkfs" >> $seqres.full
 
-echo "Repairing"
-_scratch_xfs_repair 2>> $seqres.full
+# for $dbsize
+. $tmp.mkfs
 
-echo "Removing file after repair"
 _scratch_mount
-rm -f $SCRATCH_MNT/test1
-_scratch_unmount
+# We're growing the realtime device, so force new file creation there
+_xfs_force_bdev realtime $SCRATCH_MNT
+
+echo "done"
+
+#
+# Zone RT devices can only grow by entire zones.
+# Do that twice.  The high starting code looks weird, but is neededed
+# due to the automatically added OP
+#
+for size in $(( 6 * $zone_capacity )) $(( 7 * $zone_capacity )); do
+    grow_size=$(( $size / $dbsize ))
+    _fill $SCRATCH_MNT/fill_$size
+    _do "Grow filesystem" "xfs_growfs -R $grow_size $SCRATCH_MNT"
+    echo -n "Flush filesystem... "
+    _do "_scratch_unmount"
+    _do "_try_scratch_mount"
+    echo "done"
+    echo -n "Check files... "
+    if ! _do "$here/src/fill2fs_check $tmp.manifest"; then
+      echo "fail (see $seqres.full)"
+      _do "cat $tmp.manifest"
+      _do "ls -altrR $SCRATCH_MNT"
+      status=1 ; exit
+    fi
+    echo "done"
+done
 
-status=0
-exit
+# success, all done
+echo "Growfs tests passed."
+status=0 ; exit
index d2d58ce5715ff2333103bc79dbab9984db4beee9..66cab6aba8e26ef270a61d23e07ddc3ea64be770 100644 (file)
@@ -1,3 +1,11 @@
 QA output created by 4202
-Repairing
-Removing file after repair
+Make rt filesystem on SCRATCH_DEV and mount... done
+Fill filesystem... done
+Grow filesystem... done
+Flush filesystem... done
+Check files... done
+Fill filesystem... done
+Grow filesystem... done
+Flush filesystem... done
+Check files... done
+Growfs tests passed.