From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Zhouyang Jia <jiazhouyang09@gmail.com>
Cc: Juergen Gross <jgross@suse.com>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] scsi: xen-scsifront: add error handling for xenbus_printf
Date: Thu, 14 Jun 2018 17:54:44 -0400 [thread overview]
Message-ID: <6ed19f75-20d0-9870-1334-8d0eaabd0534@oracle.com> (raw)
In-Reply-To: <1528992514-53963-1-git-send-email-jiazhouyang09@gmail.com>
On 06/14/2018 12:08 PM, Zhouyang Jia wrote:
> When xenbus_printf fails, the lack of error-handling code may
> cause unexpected results.
>
> This patch adds error-handling code after calling xenbus_printf.
>
> Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com>
> ---
> v1->v2:
> - Fix dereferencing before checking
> ---
> drivers/scsi/xen-scsifront.c | 29 ++++++++++++++++++++++-------
> 1 file changed, 22 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/scsi/xen-scsifront.c b/drivers/scsi/xen-scsifront.c
> index 36f59a1..a7f6111 100644
> --- a/drivers/scsi/xen-scsifront.c
> +++ b/drivers/scsi/xen-scsifront.c
> @@ -654,10 +654,16 @@ static int scsifront_dev_reset_handler(struct scsi_cmnd *sc)
> static int scsifront_sdev_configure(struct scsi_device *sdev)
> {
> struct vscsifrnt_info *info = shost_priv(sdev->host);
> + int err;
>
> - if (info && current == info->curr)
> - xenbus_printf(XBT_NIL, info->dev->nodename,
> + if (info && current == info->curr) {
> + err = xenbus_printf(XBT_NIL, info->dev->nodename,
> info->dev_state_path, "%d", XenbusStateConnected);
> + if (err) {
> + dev_err(&info->dev->dev, "writing dev_state_path\n");
These errors should be reported using xenbus_dev_error().
And the second patch too.
-boris
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-06-14 21:54 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-12 3:42 [PATCH] scsi: xen-scsifront: add error handling for xenbus_printf Zhouyang Jia
2018-06-13 10:09 ` Finn Thain
2018-06-14 8:13 ` Zhouyang Jia
2018-06-14 16:08 ` [PATCH v2] " Zhouyang Jia
2018-06-14 21:54 ` Boris Ostrovsky [this message]
2018-06-14 22:59 ` [PATCH v3] " Zhouyang Jia
2018-06-14 23:50 ` kbuild test robot
2018-06-15 2:32 ` kbuild test robot
2018-06-15 5:44 ` kbuild test robot
2018-06-15 1:48 ` [PATCH v4] " Zhouyang Jia
2018-06-15 6:04 ` kbuild test robot
2018-06-15 11:59 ` kbuild test robot
2018-06-15 17:05 ` [PATCH v5] " Zhouyang Jia
2018-06-19 12:53 ` Juergen Gross
2018-06-19 13:02 ` Juergen Gross
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=6ed19f75-20d0-9870-1334-8d0eaabd0534@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=jgross@suse.com \
--cc=jiazhouyang09@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox