public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Zorro Lang <zlang@redhat.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] generic/648: dmerror must be unmounted
Date: Fri, 15 Oct 2021 20:50:24 -0700	[thread overview]
Message-ID: <20211016035024.GI24282@magnolia> (raw)
In-Reply-To: <20211016021456.3097323-1-zlang@redhat.com>

On Sat, Oct 16, 2021 at 10:14:56AM +0800, Zorro Lang wrote:
> Sometimes g/648 fail to unmount dmerror with this error:
> 
>    umount: /mnt/xfstests/scratch: target is busy.
> 
> Even worse, it will cause all later test cases fail as:
> 
>   mount: bad usage
>   Try 'mount --help' for more information.
>   check: failed to mount $SCRATCH_DEV using specified options
>   Interrupted!
> 
> So we shouldn't _fail directly if dmerror_unmount fails, use a while
> loop to try to make sure it's unmounted.

Can we preserve the "iteration XXX scratch unmount failed" message,
please?

--D

> Signed-off-by: Zorro Lang <zlang@redhat.com>
> ---
>  tests/generic/648 | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/generic/648 b/tests/generic/648
> index 83dd111d..218f207b 100755
> --- a/tests/generic/648
> +++ b/tests/generic/648
> @@ -104,7 +104,7 @@ for i in $(seq 1 $((25 * TIME_FACTOR)) ); do
>  		wait > /dev/null 2>&1
>  		ps -e | grep fsstress > /dev/null 2>&1
>  	done
> -	for ((i = 0; i < 10; i++)); do
> +	for ((j = 0; j < 10; j++)); do
>  		test -e "$snap_aliveflag" || break
>  		sleep 1
>  	done
> @@ -112,7 +112,11 @@ for i in $(seq 1 $((25 * TIME_FACTOR)) ); do
>  	# Mount again to replay log after loading working table, so we have a
>  	# consistent fs after test.
>  	$UMOUNT_PROG $loopmnt
> -	_dmerror_unmount || _fail "iteration $i scratch unmount failed"
> +	_dmerror_unmount > /dev/null 2>&1
> +	while [ $? -ne 0 ]; do
> +		sleep 1
> +		_dmerror_unmount > /dev/null 2>&1
> +	done
>  	_dmerror_load_working_table
>  	if ! _dmerror_mount; then
>  		_metadump_dev $DMERROR_DEV $seqres.scratch.$i.md
> -- 
> 2.31.1
> 

  reply	other threads:[~2021-10-16  3:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-16  2:14 [PATCH] generic/648: dmerror must be unmounted Zorro Lang
2021-10-16  3:50 ` Darrick J. Wong [this message]
2021-10-16 10:09   ` Zorro Lang
2021-10-18 16:37     ` 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=20211016035024.GI24282@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@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