FS/XFS testing framework
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: Zorro Lang <zlang@redhat.com>,
	linux-btrfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH v2] common/rc: don't clear superblock for zoned scratch pools
Date: Mon, 27 Feb 2023 10:23:51 +0100	[thread overview]
Message-ID: <20230227102351.2fa21c70@echidna.fritz.box> (raw)
In-Reply-To: <20230227082717.325929-1-johannes.thumshirn@wdc.com>

Hi Johannes,

On Mon, 27 Feb 2023 00:27:17 -0800, Johannes Thumshirn wrote:

> _require_scratch_dev_pool() zeros the first 100 sectors of each device to
> clear eventual remains of older filesystems.
> 
> On zoned devices this won't work as a plain dd will end up creating
> unaligned write errors failing all subsequent actions on the device.
> 
> For zoned devices it is enough to simply reset the first two zones of the
> device to achieve the same result.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  common/rc | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index 654730b21ead..739abbdbfc8c 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3459,9 +3459,15 @@ _require_scratch_dev_pool()
>  		            exit 1
>  		        fi
>  		fi
> -		# to help better debug when something fails, we remove
> -		# traces of previous btrfs FS on the dev.
> -		dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
> +		# To help better debug when something fails, we remove
> +		# traces of previous btrfs FS on the dev. For zoned devices we
> +		# can't use dd as it'll lead to unaligned writes so simply
> +		# reset the first two zones.
> +		if [ "`_zone_type "$i"`" = "none" ]; then
> +			dd if=/dev/zero of=$i bs=4096 count=100 > /dev/null 2>&1
> +		else
> +			blkzone reset -c 2 $i
> +		fi

IIUC, any output from blkzone reset will cause test failures - is that
an intention here, or should output go to /dev/null like dd?

Looks fine otherwise.

Cheers, David

  reply	other threads:[~2023-02-27  9:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27  8:27 [PATCH v2] common/rc: don't clear superblock for zoned scratch pools Johannes Thumshirn
2023-02-27  9:23 ` David Disseldorp [this message]
2023-02-27  9:31   ` Johannes Thumshirn
2023-02-27 10:14     ` David Disseldorp
2023-03-02  7:17 ` Naohiro Aota

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=20230227102351.2fa21c70@echidna.fritz.box \
    --to=ddiss@suse.de \
    --cc=fstests@vger.kernel.org \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=zlang@redhat.com \
    /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