comparison usr/src/uts/common/rpc/svc.c @ 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 f91b268929d9
children
comparison
equal deleted inserted replaced
13987:c8aa73ad0c0b 13988:81670e8b6dd9
20 */ 20 */
21 21
22 /* 22 /*
23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved. 23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms. 24 * Use is subject to license terms.
25 */
26 /*
27 * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
25 */ 28 */
26 29
27 /* 30 /*
28 * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved. 31 * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved.
29 */ 32 */
985 * Deleted pointers are replaced with NULLs. 988 * Deleted pointers are replaced with NULLs.
986 */ 989 */
987 static void 990 static void
988 svc_xprt_qdelete(SVCPOOL *pool, SVCMASTERXPRT *xprt) 991 svc_xprt_qdelete(SVCPOOL *pool, SVCMASTERXPRT *xprt)
989 { 992 {
990 __SVCXPRT_QNODE *q = pool->p_qend; 993 __SVCXPRT_QNODE *q;
991 __SVCXPRT_QNODE *qtop = pool->p_qtop; 994
992 995 mutex_enter(&pool->p_req_lock);
993 /* 996 for (q = pool->p_qend; q != pool->p_qtop; q = q->q_next) {
994 * Delete all the references to xprt between the current
995 * position of pool->p_qend and current pool->p_qtop.
996 */
997 for (;;) {
998 if (q->q_xprt == xprt) 997 if (q->q_xprt == xprt)
999 q->q_xprt = NULL; 998 q->q_xprt = NULL;
1000 if (q == qtop) 999 }
1001 return; 1000 mutex_exit(&pool->p_req_lock);
1002 q = q->q_next;
1003 }
1004 } 1001 }
1005 1002
1006 /* 1003 /*
1007 * Destructor for a master server transport handle. 1004 * Destructor for a master server transport handle.
1008 * - if there are no more non-detached threads linked to this transport 1005 * - if there are no more non-detached threads linked to this transport