Check that xfs_repair actually rebuilds the used counter after blowing away the rmap inode and recreating it. Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: "Darrick J. Wong" <djwong@xxxxxxxxxx> --- tests/xfs/4212 | 32 ++++++++++++++++++++++++++++++++ tests/xfs/4212.out | 5 +++++ 2 files changed, 37 insertions(+) create mode 100755 tests/xfs/4212 create mode 100644 tests/xfs/4212.out diff --git a/tests/xfs/4212 b/tests/xfs/4212 new file mode 100755 index 000000000000..f392a978c7a6 --- /dev/null +++ b/tests/xfs/4212 @@ -0,0 +1,32 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Christoph Hellwig. +# +# FS QA Test No. 4212 +# +# 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/4212.out b/tests/xfs/4212.out new file mode 100644 index 000000000000..70a45a381f2d --- /dev/null +++ b/tests/xfs/4212.out @@ -0,0 +1,5 @@ +QA output created by 4212 +64+0 records in +64+0 records out +Repairing +Removing file after repair -- 2.47.2