Linux-BTRFS Archive mirror
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: Josef Bacik <josef@toxicpanda.com>,
	"fstests@vger.kernel.org" <fstests@vger.kernel.org>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	"kernel-team@fb.com" <kernel-team@fb.com>
Subject: Re: [PATCH] fstests: mkfs the scratch device if we have missing profiles
Date: Wed, 8 May 2024 11:53:31 +0000	[thread overview]
Message-ID: <06532e4a-6819-471f-ad4e-6caf897e8944@wdc.com> (raw)
In-Reply-To: <adcf935ecd3d44957ee244b91790ee7b73df134b.1715112528.git.josef@toxicpanda.com>

On 07.05.24 22:10, Josef Bacik wrote:
> I have a btrfs config where I specifically exclude raid56 testing, and
> this resulted in btrfs/011 failing with an inconsistent file system.
> This happens because the last test we run does a btrfs device replace of
> the $SCRATCH_DEV, leaving it with no valid file system.  We then skip
> the remaining profiles and exit, but then we go to check the device on
> $SCRATCH_DEV and it fails because there is no file system.
> 
> Fix this to re-make the scratch device if we skip any of the raid
> profiles.  This only happens in the case of some idiot user configuring
> their testing in a special way, in normal runs of this test we'll never
> re-make the fs.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
> ---
>   tests/btrfs/011 | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/tests/btrfs/011 b/tests/btrfs/011
> index d8b5a978..b8c14f3b 100755
> --- a/tests/btrfs/011
> +++ b/tests/btrfs/011
> @@ -257,6 +257,12 @@ for t in "-m single -d single:1 no 64" \
>   	workout_option=${t#*:}
>   	if [[ "${_btrfs_profile_configs[@]}" =~ "${mkfs_option/ -M}"( |$) ]]; then
>   		workout "$mkfs_option" $workout_option
> +	else
> +		# If we have limited the profile configs we could leave
> +		# $SCRATCH_DEV in an inconsistent state (because it was
> +		# replaced), so mkfs the scratch device to make sure we don't
> +		# trip the fs check at the end.
> +		_scratch_mkfs > /dev/null 2>&1
>   	fi
>   done
>   

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Btw, looking at test, we'd also need to remove the -M mkfs option in 
case of zoned devices as mixed profiles aren't supported there.

  reply	other threads:[~2024-05-08 11:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 20:08 [PATCH] fstests: mkfs the scratch device if we have missing profiles Josef Bacik
2024-05-08 11:53 ` Johannes Thumshirn [this message]
2024-05-24  3:51 ` Anand Jain

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=06532e4a-6819-471f-ad4e-6caf897e8944@wdc.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=fstests@vger.kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).