From: Christoph Hellwig Date: Thu, 8 May 2025 05:34:39 +0000 (+0200) Subject: xfs: test zone stream separation for two buffered writers X-Git-Tag: v2025.05.11~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7afb07edeb491a68c0447a8c348e7fc26edc24fa;p=xfstests-dev.git xfs: test zone stream separation for two buffered writers Check that two parallel buffered sequential writers are separated into different zones when writeback happens before closing the files. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/tests/xfs/641 b/tests/xfs/641 new file mode 100755 index 00000000..f39dc3d7 --- /dev/null +++ b/tests/xfs/641 @@ -0,0 +1,65 @@ +#! /bin/bash +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2024 Christoph Hellwig. +# +# FS QA Test No. 641 +# +# Test that multiple buffered I/O write streams are directed to separate zones +# when written back with the file still open. +# +. ./common/preamble +_begin_fstest quick auto rw zone + +. ./common/xfs + +_require_scratch +_require_odirect +_require_aio + +_scratch_mkfs_xfs >>$seqres.full 2>&1 +_scratch_mount +_require_xfs_scratch_zoned 3 + +fio_config=$tmp.fio +fio_out=$tmp.fio.out +fio_err=$tmp.fio.err + +cat >$fio_config <> $seqres.full + +# Check the files only have a single extent each and are in separate zones +extents1=$(_count_extents $SCRATCH_MNT/file1) +extents2=$(_count_extents $SCRATCH_MNT/file2) + +echo "number of file 1 extents: $extents1" +echo "number of file 2 extents: $extents2" + +rg1=`xfs_bmap -v $SCRATCH_MNT/file1 | _filter_bmap_gno` +rg2=`xfs_bmap -v $SCRATCH_MNT/file2 | _filter_bmap_gno` +if [ "${rg1}" == "${rg2}" ]; then + echo "same RG used for both files" +fi + +status=0 +exit diff --git a/tests/xfs/641.out b/tests/xfs/641.out new file mode 100644 index 00000000..4deaaabb --- /dev/null +++ b/tests/xfs/641.out @@ -0,0 +1,3 @@ +QA output created by 641 +number of file 1 extents: 1 +number of file 2 extents: 1