]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs: test that xfs_repair does not mess up the zone used counter
authorChristoph Hellwig <hch@lst.de>
Tue, 22 Oct 2024 08:58:49 +0000 (10:58 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 23 Oct 2024 05:10:26 +0000 (07:10 +0200)
Signed-off-by: Christoph Hellwig <hch@lst.de>
tests/xfs/4202 [new file with mode: 0755]
tests/xfs/4202.out [new file with mode: 0644]

diff --git a/tests/xfs/4202 b/tests/xfs/4202
new file mode 100755 (executable)
index 0000000..090d75a
--- /dev/null
@@ -0,0 +1,32 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2024 Christoph Hellwig.
+#
+# FS QA Test No. 4202
+#
+# Regression test for xfs_repair messing up the per-zone used counter.
+#
+
+. ./common/preamble
+_begin_fstest auto quick zone repair
+
+_require_scratch
+_require_odirect
+
+_scratch_mkfs >> $seqres.full 2>&1
+_scratch_mount
+
+dd if=/dev/zero of=$SCRATCH_MNT/test1 oflag=direct bs=1M count=64
+
+_scratch_unmount
+
+echo "Repairing"
+_scratch_xfs_repair 2>> $seqres.full
+
+echo "Removing file after repair"
+_scratch_mount
+rm -f $SCRATCH_MNT/test1
+_scratch_unmount
+
+status=0
+exit
diff --git a/tests/xfs/4202.out b/tests/xfs/4202.out
new file mode 100644 (file)
index 0000000..d2d58ce
--- /dev/null
@@ -0,0 +1,3 @@
+QA output created by 4202
+Repairing
+Removing file after repair