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

[win-pv-devel] [PATCH] Fix locking and teardown bugs in controller frontend



If the backend does not implement the control ring then the frontend will
eventually deadlock. Also, by inspection, the teardown code does not
release interfaces if the control ring was not present.

This patch fixes both issues.

Signed-off-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 src/xenvif/controller.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/xenvif/controller.c b/src/xenvif/controller.c
index e54c9fc..a90397a 100644
--- a/src/xenvif/controller.c
+++ b/src/xenvif/controller.c
@@ -797,8 +797,10 @@ ControllerDisconnect(
 
     __ControllerAcquireLock(Controller);
 
-    if (!Controller->Connected)
+    if (!Controller->Connected) {
+        __ControllerReleaseLock(Controller);
         goto done;
+    }
 
     Controller->Connected = FALSE;
 
@@ -837,6 +839,7 @@ ControllerDisconnect(
                   Controller->GnttabCache);
     Controller->GnttabCache = NULL;
 
+done:
     XENBUS_GNTTAB(Release, &Controller->GnttabInterface);
 
     XENBUS_EVTCHN(Release, &Controller->EvtchnInterface);
@@ -845,7 +848,6 @@ ControllerDisconnect(
 
     XENBUS_DEBUG(Release, &Controller->DebugInterface);
 
-done:
     Trace("<====\n");
 }
 
-- 
2.1.1


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

 


Rackspace

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