Module Name:    src
Committed By:   jdolecek
Date:           Thu Mar 26 18:50:17 UTC 2020

Modified Files:
        src/sys/arch/xen/xen: if_xennet_xenbus.c

Log Message:
in xennet_tx_complete() replace the grant status condition with just KASSERT()

it's really a possible programming error rather than something actually
happening in wild - since rev. 1.57 in 2012 this condition leaked
locked mutex, and nobody noticed


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/xen/xen/if_xennet_xenbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.95 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.96
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.95	Thu Mar 26 18:32:21 2020
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Thu Mar 26 18:50:16 2020
@@ -1,4 +1,4 @@
-/*      $NetBSD: if_xennet_xenbus.c,v 1.95 2020/03/26 18:32:21 jdolecek Exp $      */
+/*      $NetBSD: if_xennet_xenbus.c,v 1.96 2020/03/26 18:50:16 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -81,7 +81,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.95 2020/03/26 18:32:21 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.96 2020/03/26 18:50:16 jdolecek Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -951,12 +951,7 @@ again:
 		req = &sc->sc_txreqs[RING_GET_RESPONSE(&sc->sc_tx_ring, i)->id];
 		KASSERT(req->txreq_id ==
 		    RING_GET_RESPONSE(&sc->sc_tx_ring, i)->id);
-		if (__predict_false(xengnt_status(req->txreq_gntref))) {
-			aprint_verbose_dev(sc->sc_dev,
-			    "grant still used by backend\n");
-			sc->sc_tx_ring.rsp_cons = i;
-			return;
-		}
+		KASSERT(xengnt_status(req->txreq_gntref) == 0);
 		if (__predict_false(
 		    RING_GET_RESPONSE(&sc->sc_tx_ring, i)->status !=
 		    NETIF_RSP_OKAY))

Reply via email to