]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs: test zone stream separation for two direct writers
authorChristoph Hellwig <hch@lst.de>
Thu, 8 May 2025 05:34:38 +0000 (07:34 +0200)
committerZorro Lang <zlang@kernel.org>
Thu, 8 May 2025 19:17:17 +0000 (03:17 +0800)
Check that two parallel direct sequential writers are separated into
different zones.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/xfs/640 [new file with mode: 0755]
tests/xfs/640.out [new file with mode: 0644]

diff --git a/tests/xfs/640 b/tests/xfs/640
new file mode 100755 (executable)
index 0000000..65acb42
--- /dev/null
@@ -0,0 +1,65 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2024 Christoph Hellwig.
+#
+# FS QA Test No. 640
+#
+# Test that multiple direct I/O write streams are directed to separate zones.
+#
+. ./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 <<EOF
+[global]
+bs=64k
+iodepth=16
+iodepth_batch=8
+size=1m
+directory=$SCRATCH_MNT
+ioengine=libaio
+rw=write
+direct=1
+
+[file1]
+filename=file1
+size=128m
+
+[file2]
+filename=file2
+size=128m
+EOF
+
+_require_fio $fio_config
+
+$FIO_PROG $fio_config --output=$fio_out
+cat $fio_out >> $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/640.out b/tests/xfs/640.out
new file mode 100644 (file)
index 0000000..ddbc3ff
--- /dev/null
@@ -0,0 +1,3 @@
+QA output created by 640
+number of file 1 extents: 1
+number of file 2 extents: 1