Skip to content

Commit bce3ea8

Browse files
David Vrabeldavem330
authored andcommitted
xen-netfront: handle backend CLOSED without CLOSING
Backend drivers shouldn't transistion to CLOSED unless the frontend is CLOSED. If a backend does transition to CLOSED too soon then the frontend may not see the CLOSING state and will not properly shutdown. So, treat an unexpected backend CLOSED state the same as CLOSING. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e8c37af commit bce3ea8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎drivers/net/xen-netfront.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,6 @@ static void netback_changed(struct xenbus_device *dev,
18321832
case XenbusStateReconfiguring:
18331833
case XenbusStateReconfigured:
18341834
case XenbusStateUnknown:
1835-
case XenbusStateClosed:
18361835
break;
18371836

18381837
case XenbusStateInitWait:
@@ -1847,6 +1846,10 @@ static void netback_changed(struct xenbus_device *dev,
18471846
netdev_notify_peers(netdev);
18481847
break;
18491848

1849+
case XenbusStateClosed:
1850+
if (dev->state == XenbusStateClosed)
1851+
break;
1852+
/* Missed the backend's CLOSING state -- fallthrough */
18501853
case XenbusStateClosing:
18511854
xenbus_frontend_closed(dev);
18521855
break;

0 commit comments

Comments
 (0)