Re: [PATCH] generic/085: Call $UDEV_SETTLE_PROG before "dmsetup remove"

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Tue, Jun 26, 2018 at 06:59:10PM +0800, Xiao Yang wrote:
> cleanup_dmdev() may fail to remove dm device because of EBUSY
> and cause subsequent tests to fail.  Make sure dm device is
> fully settled before removing it.
> 
> PS: I am not sure whether calling "dmsetup remove --retry" is
> better or not.
> 
> Signed-off-by: Xiao Yang <yangx.jy@xxxxxxxxxxxxxx>
> ---
>  tests/generic/085 | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tests/generic/085 b/tests/generic/085
> index bed1e0d..bdc4dba 100755
> --- a/tests/generic/085
> +++ b/tests/generic/085
> @@ -32,6 +32,9 @@ cleanup_dmdev()
>  	$DMSETUP_PROG resume $lvdev >/dev/null 2>&1
>  	$UMOUNT_PROG $lvdev >/dev/null 2>&1
>  
> +	# wait for device to be fully settled so that
> +	# 'dmsetup remove' doesn't fail due to EBUSY
> +	$UDEV_SETTLE_PROG >/dev/null 2>&1
>  	$DMSETUP_PROG remove $node >>$seqres.full 2>&1

This, along with Dave's next patch that requires mknodes to be
be run after a create or remove operation makes me think we need
some wrapper functions. i.e.

_dmsetup_remove()
{
	$UDEV_SETTLE_PROG >/dev/null 2>&1
	$DMSETUP_PROG remove $* >>$seqres.full 2>&1
	$DMSETUP_PROG mknodes >/dev/null 2>&1
}

_dmsetup_create()
{
	$DMSETUP_PROG create $* >>$seqres.full 2>&1
	$DMSETUP_PROG mknodes >/dev/null 2>&1
	$UDEV_SETTLE_PROG >/dev/null 2>&1
}

And replace all the open coded create/remove operations with the
above functions...

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux