Re: [PATCH] multipathd/cli_handlers cli_resize : check pp and pgp before calling them to avoid multipathd core dump.

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

 



On lun., 2013-06-17 at 11:53 +0800, taget@xxxxxxxxxxxxxxxxxx wrote:
> From: Eli Qiao <taget@xxxxxxxxxxxxxxxxxx>
> 
Applied.
Thanks,

Christophe Varoqui
www.opensvc.com

> Signed-off-by: Eli Qiao <taget@xxxxxxxxxxxxxxxxxx>
> ---
>  multipathd/cli_handlers.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
> index 7b1cb62..4b860bb 100644
> --- a/multipathd/cli_handlers.c
> +++ b/multipathd/cli_handlers.c
> @@ -603,7 +603,18 @@ cli_resize(void *v, char **reply, int *len, void *data)
>  	}
>  
>  	pgp = VECTOR_SLOT(mpp->pg, 0);
> +
> +	if (!pgp){
> +		condlog(0, "%s: couldn't get path group. cannot resize",
> +			mapname);
> +		return 1;
> +	}
>  	pp = VECTOR_SLOT(pgp->paths, 0);
> +
> +	if (!pp){
> +		condlog(0, "%s: couldn't get path. cannot resize", mapname);
> +		return 1;
> +	}
>  	if (!pp->udev || sysfs_get_size(pp, &size)) {
>  		condlog(0, "%s: couldn't get size for sysfs. cannot resize",
>  			mapname);


--
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