From: Glauber de Oliveira Costa Subject: [PATCH] Avoid netfront reaching BUG() condition Date: Thu, 14 Dec 2006 11:42:54 -0500 Message-ID: <1166114574.2371.19.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-Dt4mlchPajKvGT4Z7dAi" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-Dt4mlchPajKvGT4Z7dAi Content-Type: text/plain Content-Transfer-Encoding: 7bit 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. --=-Dt4mlchPajKvGT4Z7dAi Content-Disposition: attachment; filename=avoid-netfront-bug.patch Content-Type: text/x-patch; name=avoid-netfront-bug.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit # HG changeset patch # User gcosta@redhat.com # 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() Signed-off-by: Glauber de Oliveira Costa diff -r 35c724302bdd -r ddab7c52fc80 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Thu Dec 14 11:09:27 2006 +0000 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Thu Dec 14 09:41:19 2006 -0500 @@ -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; } } --=-Dt4mlchPajKvGT4Z7dAi Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-Dt4mlchPajKvGT4Z7dAi--