public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: David Vrabel <david.vrabel@citrix.com>
Cc: Chen Gang <gang.chen.5i5j@gmail.com>,
	konrad.wilk@oracle.com, ian.campbell@citrix.com,
	wei.liu2@citrix.com, boris.ostrovsky@oracle.com,
	bhelgaas@google.com, jgross@suse.com,
	yongjun_wei@trendmicro.com.cn, mukesh.rathor@oracle.com,
	xen-devel@lists.xenproject.org, linux-pci@vger.kernel.org,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linux-scsi@vger.kernel.org,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [Xen-devel] [PATCH] xen/xenbus: Use 'void' instead of 'int' for the return of xenbus_switch_state()
Date: Mon, 29 Sep 2014 09:41:51 +0100	[thread overview]
Message-ID: <20140929084102.GE28628@zion.uk.xensource.com> (raw)
In-Reply-To: <5425AB57.8040804@citrix.com>

On Fri, Sep 26, 2014 at 07:07:19PM +0100, David Vrabel wrote:
> On 26/09/14 17:36, Chen Gang wrote:
> > When xenbus_switch_state() fails, it will call xenbus_switch_fatal()
> > internally, so need not return any status value, then use 'void' instead
> > of 'int' for xenbus_switch_state() and __xenbus_switch_state().
> > 
> > Also need be sure that all callers which check the return value must let
> > 'err' be 0.
> 
> I've rewritten the commit message as:
> 
>     xen/xenbus: don't return errors from xenbus_switch_state()
> 
>     Most users of xenbus_switch_state() weren't handling the failure of
>     xenbus_switch_state() correctly.  They either called
>     xenbus_dev_fatal() (which xenbus_switch_state() has effectively
>     already tried to do), or ignored errors.
> 
>     xenbus_switch_state() may fail because:
> 
>     a) The device is being unplugged by the toolstack. The device will
>     shortly be removed and the error does not need to be handled.
> 
>     b) Xenstore is broken.  There isn't much the driver can do in this
>     case since xenstore is required to signal failure to the toolstack.
> 
>     So, don't report any errors from xenbus_switch_state() which removes
>     some unnecessary error handling in some of the drivers.
> 
> I'd appreciate a review from some of the other front/backend driver
> maintainers on whether this is sensible reasoning.
> 

Looks reasonable to me.

Wei.

  parent reply	other threads:[~2014-09-29  8:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-26 16:36 [PATCH] xen/xenbus: Use 'void' instead of 'int' for the return of xenbus_switch_state() Chen Gang
2014-09-26 18:07 ` [Xen-devel] " David Vrabel
2014-09-27  9:20   ` Chen Gang
2014-09-29  8:41   ` Wei Liu [this message]
2014-09-29 14:03   ` Konrad Rzeszutek Wilk
2014-09-29  5:09 ` Juergen Gross
2014-09-29 13:35 ` Bjorn Helgaas
2014-09-29 14:02 ` Konrad Rzeszutek Wilk
2014-09-29 14:17   ` David Vrabel
2014-09-29 15:40     ` Konrad Rzeszutek Wilk
2014-09-29 17:14       ` David Vrabel
2014-09-30  8:04   ` Chen Gang
2014-09-30  9:55 ` David Vrabel
2014-09-30 10:10   ` Chen Gang

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=20140929084102.GE28628@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=bhelgaas@google.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=gang.chen.5i5j@gmail.com \
    --cc=ian.campbell@citrix.com \
    --cc=jgross@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mukesh.rathor@oracle.com \
    --cc=netdev@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --cc=yongjun_wei@trendmicro.com.cn \
    /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