From: Christoph Hellwig Date: Thu, 8 May 2025 05:34:43 +0000 (+0200) Subject: xfs: test that xfs_repair does not mess up the zone used counter X-Git-Tag: v2025.05.11~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d6c292e41ccec1ad1b8335a3f339ab6ea2b2d574;p=xfstests-dev.git xfs: test that xfs_repair does not mess up the zone used counter Check that xfs_repair actually rebuilds the used counter after blowing away the rmap inode and recreating it. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/tests/xfs/645 b/tests/xfs/645 new file mode 100755 index 00000000..dd56fe7c --- /dev/null +++ b/tests/xfs/645 @@ -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 index 00000000..435b7795 --- /dev/null +++ b/tests/xfs/645.out @@ -0,0 +1,5 @@ +QA output created by 645 +64+0 records in +64+0 records out +Repairing +Removing file after repair