lkml.org 
[lkml]   [2014]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Xen-devel] [PATCH] xen/xen-scsiback: Need go to fail after xenbus_dev_error()
>>> On 29.09.14 at 06:32, <JGross@suse.com> wrote:
> On 09/26/2014 06:38 PM, Chen Gang wrote:
>> When failure occurs, after xenbus_dev_error(), need go to fail to let
>> upper caller know about it.
>>
>> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
>> ---
>> drivers/xen/xen-scsiback.c | 4 +++-
>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
>> index 847bc9c..3e430e1 100644
>> --- a/drivers/xen/xen-scsiback.c
>> +++ b/drivers/xen/xen-scsiback.c
>> @@ -1222,8 +1222,10 @@ static int scsiback_probe(struct xenbus_device *dev,
>>
>> err = xenbus_printf(XBT_NIL, dev->nodename, "feature-sg-grant", "%u",
>> SG_ALL);
>> - if (err)
>> + if (err) {
>> xenbus_dev_error(dev, err, "writing feature-sg-grant");
>> + goto fail;
>> + }
>>
>> xenbus_switch_state(dev, XenbusStateInitWait);
>> return 0;
>>
>
> Hmm, not testing for failure was on purpose. Advertising this feature
> is just for tuning purposes, not mandatory.
>
> OTOH it would really be a strange error if this xenbus_printf() fails
> but all other operations are working, and signaling an error at the
> time when it first shows up is a good thing. So:

I disagree - failure to announce optional features should not lead to
general failure. And this should be consistent across drivers; for
existing examples see xen_blkbk_flush_diskcache() and
xen_blkbk_discard().

Jan



\
 
 \ /
  Last update: 2014-09-29 11:01    [W:0.118 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site