summaryrefslogtreecommitdiff
path: root/kernel/ksysfs.c
diff options
context:
space:
mode:
authorIan Campbell <Ian.Campbell@citrix.com>2015-06-01 11:30:24 +0100
committerZefan Li <lizefan@huawei.com>2015-06-19 11:40:35 +0800
commit366df578d3354ee84edc4e0e731ad47678f09e4e (patch)
tree6c82389c68013d405651ca305d9fec054c08fab4 /kernel/ksysfs.c
parente0483eb80cb0f7ffc160da18ddd95434ae3e8c34 (diff)
xen: netback: read hotplug script once at start of day.
commit 31a418986a5852034d520a5bab546821ff1ccf3d upstream. When we come to tear things down in netback_remove() and generate the uevent it is possible that the xenstore directory has already been removed (details below). In such cases netback_uevent() won't be able to read the hotplug script and will write a xenstore error node. A recent change to the hypervisor exposed this race such that we now sometimes lose it (where apparently we didn't ever before). Instead read the hotplug script configuration during setup and use it for the lifetime of the backend device. The apparently more obvious fix of moving the transition to state=Closed in netback_remove() to after the uevent does not work because it is possible that we are already in state=Closed (in reaction to the guest having disconnected as it shutdown). Being already in Closed means the toolstack is at liberty to start tearing down the xenstore directories. In principal it might be possible to arrange to unregister the device sooner (e.g on transition to Closing) such that xenstore would still be there but this state machine is fragile and prone to anger... A modern Xen system only relies on the hotplug uevent for driver domains, when the backend is in the same domain as the toolstack it will run the necessary setup/teardown directly in the correct sequence wrt xenstore changes. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'kernel/ksysfs.c')
0 files changed, 0 insertions, 0 deletions