changeset 13988:81670e8b6dd9

3620 Corruption of the `xprt-ready' queue in svc_xprt_qdelete() Reviewed by: Boris Protopopov <Boris.Protopopov@nexenta.com> Reviewed by: Gordon Ross <gordon.ross@nexenta.com> Reviewed by: Jeffry Molanus <Jeffry.Molanus@nexenta.com> Approved by: Richard Lowe <richlowe@richlowe.net>
author Marcel Telka <Marcel.Telka@nexenta.com>
date Fri, 15 Mar 2013 16:26:41 -0400
parents c8aa73ad0c0b
children c97356b78587
files usr/src/uts/common/rpc/svc.c
diffstat 1 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/rpc/svc.c	Thu Mar 14 21:56:45 2013 -0800
+++ b/usr/src/uts/common/rpc/svc.c	Fri Mar 15 16:26:41 2013 -0400
@@ -23,6 +23,9 @@
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
+/*
+ * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
+ */
 
 /*
  * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved.
@@ -987,20 +990,14 @@
 static void
 svc_xprt_qdelete(SVCPOOL *pool, SVCMASTERXPRT *xprt)
 {
-	__SVCXPRT_QNODE *q = pool->p_qend;
-	__SVCXPRT_QNODE *qtop = pool->p_qtop;
+	__SVCXPRT_QNODE *q;
 
-	/*
-	 * Delete all the references to xprt between the current
-	 * position of pool->p_qend and current pool->p_qtop.
-	 */
-	for (;;) {
+	mutex_enter(&pool->p_req_lock);
+	for (q = pool->p_qend; q != pool->p_qtop; q = q->q_next) {
 		if (q->q_xprt == xprt)
 			q->q_xprt = NULL;
-		if (q == qtop)
-			return;
-		q = q->q_next;
 	}
+	mutex_exit(&pool->p_req_lock);
 }
 
 /*