From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] xen-scsiback: correct return value checks on xenbus_scanf()
Date: Thu, 7 Jul 2016 14:34:46 +0200 [thread overview]
Message-ID: <577E4C66.6010800@suse.com> (raw)
In-Reply-To: <577E286802000078000FBECF@suse.com>
On 07/07/16 10:01, Jan Beulich wrote:
> Only a positive return value indicates success.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Juergen Gross <jgross@suse.com>
> ---
> 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;
>
>
next prev parent reply other threads:[~2016-07-07 12:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <577E286802000078000FBECF@suse.com>
2016-07-07 12:34 ` [PATCH] xen-scsiback: correct return value checks on xenbus_scanf() Juergen Gross
2016-07-07 12:34 ` Juergen Gross [this message]
2016-07-07 8:01 Jan Beulich
-- strict thread matches above, loose matches on Subject: below --
2016-07-07 8:01 Jan Beulich
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=577E4C66.6010800@suse.com \
--to=jgross@suse.com \
--cc=JBeulich@suse.com \
--cc=linux-scsi@vger.kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.