From: Christoph Hellwig Date: Thu, 8 May 2025 05:34:37 +0000 (+0200) Subject: xfs: add a test for writeback after close X-Git-Tag: v2025.05.11~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=9675a9d44545e1cea57a9226b5caf29bad7744a0;p=xfstests-dev.git xfs: add a test for writeback after close Test that files written back after closing are packed tightly instead of using up open zone resources. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/tests/xfs/639 b/tests/xfs/639 new file mode 100755 index 00000000..6af1c9fd --- /dev/null +++ b/tests/xfs/639 @@ -0,0 +1,41 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Christoph Hellwig. +# +# FS QA Test No. 639 +# +# Test that data is packed tighly for writeback after the files were +# closed. +# +. ./common/preamble +_begin_fstest auto quick rw zone + +. ./common/xfs + +_require_scratch + +_scratch_mkfs_xfs >>$seqres.full 2>&1 +_scratch_mount +_require_xfs_scratch_zoned + +# Create a bunch of small files +for i in `seq 1 100`; do + file=$SCRATCH_MNT/$i + + $XFS_IO_PROG -f -c 'pwrite 0 8k' $file >>$seqres.full +done + +sync + +# Check that all small files are placed together +short_rg=`xfs_bmap -v $SCRATCH_MNT/1 | _filter_bmap_gno` +for i in `seq 2 100`; do + file=$SCRATCH_MNT/$i + rg=`xfs_bmap -v $file | _filter_bmap_gno` + if [ "${rg}" != "${short_rg}" ]; then + echo "RG mismatch for file $i: $short_rg/$rg" + fi +done + +status=0 +exit diff --git a/tests/xfs/639.out b/tests/xfs/639.out new file mode 100644 index 00000000..85d98606 --- /dev/null +++ b/tests/xfs/639.out @@ -0,0 +1 @@ +QA output created by 639