Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Zorro Lang <zlang@kernel.org>,
	Hans Holmberg <hans.holmberg@wdc.com>,
	fstests@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 15/15] xfs: test that we can handle spurious zone wp advancements
Date: Fri, 2 May 2025 09:04:36 -0700	[thread overview]
Message-ID: <20250502160436.GO25667@frogsfrogsfrogs> (raw)
In-Reply-To: <20250501134302.2881773-16-hch@lst.de>

On Thu, May 01, 2025 at 08:42:52AM -0500, Christoph Hellwig wrote:
> From: Hans Holmberg <Hans.Holmberg@wdc.com>
> 
> Test that we can gracefully handle spurious zone write pointer
> advancements while unmounted.
> 
> Any space covered by the wp unexpectedly moving forward should just
> be treated as unused space, so check that we can still mount the file
> system and that the zone will be reset when all used blocks have been
> freed.
> 
> Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  tests/xfs/4214     | 61 ++++++++++++++++++++++++++++++++++++++++++++++
>  tests/xfs/4214.out |  2 ++
>  2 files changed, 63 insertions(+)
>  create mode 100755 tests/xfs/4214
>  create mode 100644 tests/xfs/4214.out
> 
> diff --git a/tests/xfs/4214 b/tests/xfs/4214
> new file mode 100755
> index 000000000000..3e73a54614d5
> --- /dev/null
> +++ b/tests/xfs/4214
> @@ -0,0 +1,61 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2025 Western Digital Corporation.  All Rights Reserved.
> +#
> +# FS QA Test 4214
> +#
> +# Test that we can gracefully handle spurious zone write pointer
> +# advancements while unmounted.
> +#
> +
> +. ./common/preamble
> +_begin_fstest auto quick zone
> +
> +# Import common functions.
> +. ./common/filter
> +. ./common/zoned
> +
> +_require_scratch

Needs _require_realtime so that the next command doesn't fail on
undefined SCRATCH_RTDEV

> +_require_zoned_device $SCRATCH_RTDEV
> +_require_command "$BLKZONE_PROG" blkzone
> +
> +_scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
> +_scratch_mount
> +blksz=$(_get_file_block_size $SCRATCH_MNT)
> +
> +test_file=$SCRATCH_MNT/test.dat
> +dd if=/dev/zero of=$test_file bs=1M count=16 >> $seqres.full 2>&1 \
> +	oflag=direct || _fail "file creation failed"
> +
> +_scratch_unmount
> +
> +#
> +# Figure out which zone was opened to store the test file and where
> +# the write pointer is in that zone
> +#
> +open_zone=$($BLKZONE_PROG report $SCRATCH_RTDEV | \
> +	$AWK_PROG '/oi/ { print $2 }' | sed 's/,//')
> +open_zone_wp=$($BLKZONE_PROG report $SCRATCH_RTDEV | \
> +       	grep "start: $open_zone" | $AWK_PROG '{ print $8 }')

   ^ spaces here before a tab

--D

> +wp=$(( $open_zone + $open_zone_wp ))
> +
> +# Advance the write pointer manually by one block
> +dd if=/dev/zero of=$SCRATCH_RTDEV bs=$blksz count=1 seek=$(($wp * 512 / $blksz))\
> +	oflag=direct >> $seqres.full 2>&1 || _fail "wp advancement failed"
> +
> +_scratch_mount
> +_scratch_unmount
> +
> +# Finish the open zone
> +$BLKZONE_PROG finish -c 1 -o $open_zone $SCRATCH_RTDEV
> +
> +_scratch_mount
> +rm $test_file
> +_scratch_unmount
> +
> +# The previously open zone, now finished and unused, should have been reset
> +nr_open=$($BLKZONE_PROG report $SCRATCH_RTDEV | grep -wc "oi")
> +echo "Number of open zones: $nr_open"
> +
> +status=0
> +exit
> diff --git a/tests/xfs/4214.out b/tests/xfs/4214.out
> new file mode 100644
> index 000000000000..a746546bc8f6
> --- /dev/null
> +++ b/tests/xfs/4214.out
> @@ -0,0 +1,2 @@
> +QA output created by 4214
> +Number of open zones: 0
> -- 
> 2.47.2
> 
> 

  reply	other threads:[~2025-05-02 16:04 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-01 13:42 new tests for zoned xfs Christoph Hellwig
2025-05-01 13:42 ` [PATCH 01/15] xfs: add a zoned growfs test Christoph Hellwig
2025-05-01 13:42 ` [PATCH 02/15] xfs: add a test for zoned block accounting after remount Christoph Hellwig
2025-05-06 19:32   ` Zorro Lang
2025-05-01 13:42 ` [PATCH 03/15] xfs: add test to check for block layer reordering Christoph Hellwig
2025-05-01 13:42 ` [PATCH 04/15] xfs: add a test to check that data growfs fails with internal rt device Christoph Hellwig
2025-05-06 19:35   ` Zorro Lang
2025-05-01 13:42 ` [PATCH 05/15] add a new rw_hint helper Christoph Hellwig
2025-05-01 13:42 ` [PATCH 06/15] xfs: add a test for write lifetime hints Christoph Hellwig
2025-05-06 19:42   ` Zorro Lang
2025-05-01 13:42 ` [PATCH 07/15] xfs: add a test for writeback after close Christoph Hellwig
2025-05-06 19:45   ` Zorro Lang
2025-05-01 13:42 ` [PATCH 08/15] xfs: test zone stream separation for two direct writers Christoph Hellwig
2025-05-06 19:52   ` Zorro Lang
2025-05-01 13:42 ` [PATCH 09/15] xfs: test zone stream separation for two buffered writers Christoph Hellwig
2025-05-06 19:54   ` Zorro Lang
2025-05-01 13:42 ` [PATCH 10/15] xfs: test zoned ENOSPC behavior with multiple writers Christoph Hellwig
2025-05-06 19:58   ` Zorro Lang
2025-05-01 13:42 ` [PATCH 11/15] xfs: test zoned GC file defragmentation for sequential writers Christoph Hellwig
2025-05-06 20:00   ` Zorro Lang
2025-05-01 13:42 ` [PATCH 12/15] xfs: test zoned GC file defragmentation for random writers Christoph Hellwig
2025-05-06 20:01   ` Zorro Lang
2025-05-01 13:42 ` [PATCH 13/15] xfs: test that xfs_repair does not mess up the zone used counter Christoph Hellwig
2025-05-01 13:42 ` [PATCH 14/15] xfs: test that truncate does not spuriously return ENOSPC Christoph Hellwig
2025-05-06 20:06   ` Zorro Lang
2025-05-01 13:42 ` [PATCH 15/15] xfs: test that we can handle spurious zone wp advancements Christoph Hellwig
2025-05-02 16:04   ` Darrick J. Wong [this message]
2025-05-05 13:01     ` Hans Holmberg
2025-05-05  9:51   ` [PATCH v2 " Hans Holmberg
2025-05-05 15:08     ` Darrick J. Wong
2025-05-06 20:16     ` Zorro Lang
2025-05-07  5:12     ` hch
2025-05-07  6:05       ` Hans Holmberg
2025-05-01 21:55 ` new tests for zoned xfs Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250502160436.GO25667@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=hans.holmberg@wdc.com \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox