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

Re: [Xen-devel] [PATCH] xen-scsiback: correct return value checks on xenbus_scanf()



On 07/07/16 10:01, Jan Beulich wrote:
> Only a positive return value indicates success.
> 
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Juergen Gross <jgross@xxxxxxxx>

> ---
>  drivers/xen/xen-scsiback.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- 4.7-rc6-xenbus_scanf.orig/drivers/xen/xen-scsiback.c
> +++ 4.7-rc6-xenbus_scanf/drivers/xen/xen-scsiback.c
> @@ -1071,7 +1071,7 @@ static void scsiback_do_1lun_hotplug(str
>       /* read status */
>       snprintf(state, sizeof(state), "vscsi-devs/%s/state", ent);
>       err = xenbus_scanf(XBT_NIL, dev->nodename, state, "%u", &device_state);
> -     if (XENBUS_EXIST_ERR(err))
> +     if (err <= 0)
>               return;
>  
>       /* physical SCSI device */
> @@ -1089,7 +1089,7 @@ static void scsiback_do_1lun_hotplug(str
>       snprintf(str, sizeof(str), "vscsi-devs/%s/v-dev", ent);
>       err = xenbus_scanf(XBT_NIL, dev->nodename, str, "%u:%u:%u:%u",
>                          &vir.hst, &vir.chn, &vir.tgt, &vir.lun);
> -     if (XENBUS_EXIST_ERR(err)) {
> +     if (err != 4) {
>               xenbus_printf(XBT_NIL, dev->nodename, state,
>                             "%d", XenbusStateClosed);
>               return;
> 
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.