Skip to contentSkip to conversation

Avoid netfront reaching BUG() condition

PATCH New Glauber de Oliveira Costa 1 participant 1 message Dec 14, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Avoid netfront reaching BUG() condition

As we previously discussed in
http://lists.xensource.com/archives/html/xen-devel/2006-12/msg00611.html , netfront driver reaches a BUG() condition due to a undesirable but legal double delivery of XenbusStateClosing state change. Follows a fix.

# HG changeset patch
# User [email protected]
# Date 1166107279 18000
# Node ID ddab7c52fc80ffa867df2eaa99c9af2b4b4383a9 # Parent 35c724302bdd1339e17dad43085c841917a5dd88 [LINUX] Prevent closing netfront in double state change

If it happens for xenbus to deliver a Closing change state for whatever reason, frontend will try to unregister already-unregistered structures, leading guest to BUG()

linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +4 -1
diff -r 35c724302bdd -r ddab7c52fc80 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
@@ -532,7 +532,10 @@ static void backend_changed(struct xenbu
 		break;
 
 	case XenbusStateClosing:
-		netfront_closing(dev);
+		if (dev->state != XenbusStateClosed)
+			netfront_closing(dev);
+		else
+			WPRINTK("Ignoring Closing request after already Closed");
 		break;
 	}
 }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel