Skip to content

Commit cd0d704

Browse files
Paul Durrantthangqn-ampere
Paul Durrant
authored andcommitted
xen-netback: only remove 'hotplug-status' when the vif is actually destroyed
[ Upstream commit c55f34b ] Removing 'hotplug-status' in backend_disconnected() means that it will be removed even in the case that the frontend unilaterally disconnects (which it is free to do at any time). The consequence of this is that, when the frontend attempts to re-connect, the backend gets stuck in 'InitWait' rather than moving straight to 'Connected' (which it can do because the hotplug script has already run). Instead, the 'hotplug-status' mode should be removed in netback_remove() i.e. when the vif really is going away. Fixes: 0f4558a ("Revert "xen-netback: remove 'hotplug-status' once it has served its purpose"") Signed-off-by: Paul Durrant <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d6144f3 commit cd0d704

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/xen-netback/xenbus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ static void backend_disconnect(struct backend_info *be)
256256
unsigned int queue_index;
257257

258258
xen_unregister_watchers(vif);
259-
xenbus_rm(XBT_NIL, be->dev->nodename, "hotplug-status");
260259
#ifdef CONFIG_DEBUG_FS
261260
xenvif_debugfs_delif(vif);
262261
#endif /* CONFIG_DEBUG_FS */
@@ -984,6 +983,7 @@ static int netback_remove(struct xenbus_device *dev)
984983
struct backend_info *be = dev_get_drvdata(&dev->dev);
985984

986985
unregister_hotplug_status_watch(be);
986+
xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status");
987987
if (be->vif) {
988988
kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
989989
backend_disconnect(be);

0 commit comments

Comments
 (0)