From: Christoph Hellwig Date: Thu, 8 May 2025 05:34:32 +0000 (+0200) Subject: xfs: add a test for zoned block accounting after remount X-Git-Tag: v2025.05.11~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9e3423e418f033dddd043d139854360bfd050683;p=xfstests-dev.git xfs: add a test for zoned block accounting after remount Test for a problem with an earlier version of the zoned XFS mount code where freeded blocks in an open zone weren't properly accounted for. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/tests/xfs/634 b/tests/xfs/634 new file mode 100755 index 00000000..eef2be91 --- /dev/null +++ b/tests/xfs/634 @@ -0,0 +1,40 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Christoph Hellwig. +# +# FS QA Test No. 634 +# +# Regression test for mount time accounting of an open zone with freed blocks. +# + +. ./common/preamble +_begin_fstest auto quick zone + +_require_scratch +_require_odirect + +# +# Create a 256MB file system. This is picked as the lowest common zone size +# to ensure both files are placed into the same zone. +# +_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 +_scratch_mount + +dd if=/dev/zero of=$SCRATCH_MNT/test1 oflag=direct conv=fsync bs=1M count=32 +dd if=/dev/zero of=$SCRATCH_MNT/test2 oflag=direct conv=fsync bs=1M count=32 +rm $SCRATCH_MNT/test1 + +# let delayed inode deactivate do its work +sleep 1 +df -h $SCRATCH_MNT > $tmp.df.old + +_scratch_cycle_mount + +echo "Check that df output matches after remount" +df -h $SCRATCH_MNT > $tmp.df.new +diff -u $tmp.df.old $tmp.df.new + +_scratch_unmount + +status=0 +exit diff --git a/tests/xfs/634.out b/tests/xfs/634.out new file mode 100644 index 00000000..8629ba48 --- /dev/null +++ b/tests/xfs/634.out @@ -0,0 +1,6 @@ +QA output created by 634 +32+0 records in +32+0 records out +32+0 records in +32+0 records out +Check that df output matches after remount