[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140929084102.GE28628@zion.uk.xensource.com>
Date: Mon, 29 Sep 2014 09:41:51 +0100
From: Wei Liu <wei.liu2@...rix.com>
To: David Vrabel <david.vrabel@...rix.com>
CC: Chen Gang <gang.chen.5i5j@...il.com>, <konrad.wilk@...cle.com>,
<ian.campbell@...rix.com>, <wei.liu2@...rix.com>,
<boris.ostrovsky@...cle.com>, <bhelgaas@...gle.com>,
<jgross@...e.com>, <yongjun_wei@...ndmicro.com.cn>,
<mukesh.rathor@...cle.com>, <xen-devel@...ts.xenproject.org>,
<linux-pci@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
<linux-scsi@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [Xen-devel] [PATCH] xen/xenbus: Use 'void' instead of 'int' for
the return of xenbus_switch_state()
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists