[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] linux-2.6.18/blkback: also call blkif_disconnect() when frontend switched to closed
blkfront doesn't normally set its state to XenbusStateClosing, yet blkback should not hang on to resources when there's no connection. As frontend_changed() already makes use of blkif_disconnect() being idempotent, we're fine to utilize this here too. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> --- a/drivers/xen/blkback/xenbus.c +++ b/drivers/xen/blkback/xenbus.c @@ -392,13 +392,11 @@ static void frontend_changed(struct xenb break; case XenbusStateClosing: - blkif_disconnect(be->blkif); - xenbus_switch_state(dev, XenbusStateClosing); - break; - case XenbusStateClosed: - xenbus_switch_state(dev, XenbusStateClosed); - if (xenbus_dev_is_online(dev)) + blkif_disconnect(be->blkif); + xenbus_switch_state(dev, frontend_state); + if (frontend_state != XenbusStateClosed || + xenbus_dev_is_online(dev)) break; /* fall through if not online */ case XenbusStateUnknown: Attachment:
xen-blkback-disconnect.patch _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |