Re: [PATCH v3 18/19] libmultipath: Don't blank intialized paths

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

 



On Fri, 2018-09-21 at 18:05 -0500, Benjamin Marzinski wrote:
> When pathinfo fails for some likely transient reason, it clears the
> path
> wwid, but otherwise returns successfully, to keep the path around but
> not usable until it gets fully initialized. However, if the path has
> already been initialized, and pathinfo hits a transient error, it
> shouldn't clear the wwid.
> 
> Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>
> ---
>  libmultipath/discovery.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
> index 3e0db7f..33815dc 100644
> --- a/libmultipath/discovery.c
> +++ b/libmultipath/discovery.c
> @@ -1991,9 +1991,9 @@ blank:
>  	/*
>  	 * Recoverable error, for example faulty or offline path
>  	 */
> -	memset(pp->wwid, 0, WWID_SIZE);
>  	pp->chkrstate = pp->state = PATH_DOWN;
> -	pp->initialized = INIT_FAILED;
> +	if (pp->initialized == INIT_FAILED)
> +		memset(pp->wwid, 0, WWID_SIZE);
>  
>  	return PATHINFO_OK;
>  }

I am uncertain about this one. The old code sets pp->initialized to
INIT_FAILED. If the state had been INIT_MISSING_UDEV or
INIT_REQUESTED_UDEV before, this patch might change how the code
behaves later in check_path(), where these conditions are checked.

Likewise, tests for strlen(pp->wwid) are used in various places around
the code. These tests would now yield different results for paths in
"recoverable error" state.

Have you considered these possible side effects?

Martin

-- 
Dr. Martin Wilck <mwilck@xxxxxxxx>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux