[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [linux-2.6.18-xen] blkback: also call blkif_disconnect() when frontend switched to closed



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1331551683 -3600
# Node ID 4c2b7dcbfd8b87a82a0e6c4606f1a4079ab91952
# Parent  1a12d75a97bdea29e646956e1b4483f7e37b6076
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>
---


diff -r 1a12d75a97bd -r 4c2b7dcbfd8b drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c      Mon Mar 12 12:26:58 2012 +0100
+++ b/drivers/xen/blkback/xenbus.c      Mon Mar 12 12:28:03 2012 +0100
@@ -392,13 +392,11 @@
                break;
 
        case XenbusStateClosing:
+       case XenbusStateClosed:
                blkif_disconnect(be->blkif);
-               xenbus_switch_state(dev, XenbusStateClosing);
-               break;
-
-       case XenbusStateClosed:
-               xenbus_switch_state(dev, XenbusStateClosed);
-               if (xenbus_dev_is_online(dev))
+               xenbus_switch_state(dev, frontend_state);
+               if (frontend_state != XenbusStateClosed ||
+                   xenbus_dev_is_online(dev))
                        break;
                /* fall through if not online */
        case XenbusStateUnknown:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.