]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs: test that xfs_repair does not mess up the zone used counter
authorChristoph Hellwig <hch@lst.de>
Thu, 8 May 2025 05:34:43 +0000 (07:34 +0200)
committerZorro Lang <zlang@kernel.org>
Thu, 8 May 2025 19:17:17 +0000 (03:17 +0800)
Check that xfs_repair actually rebuilds the used counter after blowing
away the rmap inode and recreating it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/645 [new file with mode: 0755]
tests/xfs/645.out [new file with mode: 0644]

diff --git a/tests/xfs/645 b/tests/xfs/645
new file mode 100755 (executable)
index 0000000..dd56fe7
--- /dev/null
@@ -0,0 +1,32 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2024 Christoph Hellwig.
+#
+# FS QA Test No. 645
+#
+# 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/645.out b/tests/xfs/645.out
new file mode 100644 (file)
index 0000000..435b779
--- /dev/null
@@ -0,0 +1,5 @@
+QA output created by 645
+64+0 records in
+64+0 records out
+Repairing
+Removing file after repair