Re: [Xen-devel] [PATCH 3/3 v2] xen/xenbus: Improve failure processing code for __xenbus_switch_state()

From: Chen Gang
Date: Mon Sep 22 2014 - 21:51:06 EST


On 9/23/14 0:01, David Vrabel wrote:
> On 22/09/14 16:51, Chen Gang wrote:
>> On 09/22/2014 11:04 PM, David Vrabel wrote:
>>> On 18/09/14 15:01, Chen Gang wrote:
>>>> When failure occurs, need return failure code instead of 0, or some of
>>>> indirect upper callers may misunderstand.
>>>>
>>>> e.g. in "block/xen-blkback/xenbus.c":
>>>>
>>>> connect() -> xenbus_switch_state() -> __xenbus_switch_state().
>>>
>>> Can you make xenbus_switch_state() void? The callers don't need to do
>>> any error handling.
>>>
>>
>> After "grep rn xenbus_switch_state *" under "drivers/", it is not one
>> place to check the return value of xenbus_switch_state(), and also it
>> is export to outside for individual modules.
>>
>> So we need change many subsystems for it, and also need face the rick
>> for incompatible with the old individual modules which source code are
>> not in upstream.
>
> Having to update 9 callers doesn't seem like much work.
>

OK, thanks, and I guess, we need not care about the individual modules
which source code are not in upstream.

>> And are you sure the caller need not notice about it, when it really
>> fails? (for me, I guess they need notice about it)
>
> Yes. xenbus_switch_state() already signals the fatal error to the
> toolstack with xenbus_dev_fatal().
>

OK, what you said sound reasonable to me, I shall send patch v3 for it
within this week (do not consider about the individual modules which
source code are not in upstream).


Thanks.
--
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/