# HG changeset patch # User Robert Mustacchi # Date 1363652169 0 # Node ID 971fb4176acf303a4431040f1274f8e345c1afd7 # Parent d267bde9b5cf49cb39c4f36b3339ed80f3f6df30 3939 parent rn_lock being held across calls to rc_hold Reviewed by: Jerry Jelinek Reviewed by: Gordon Ross Reviewed by: Eric Schrock Approved by: Dan McDonald diff -r d267bde9b5cf -r 971fb4176acf usr/src/cmd/svc/configd/rc_node.c --- a/usr/src/cmd/svc/configd/rc_node.c Thu Feb 28 07:21:34 2013 +0000 +++ b/usr/src/cmd/svc/configd/rc_node.c Tue Mar 19 00:16:09 2013 +0000 @@ -21,6 +21,7 @@ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* @@ -6534,7 +6535,15 @@ } if (pg == NULL) { + (void) pthread_mutex_unlock(&np->rn_lock); rc_node_rele(res); + (void) pthread_mutex_lock(&np->rn_lock); + if (!rc_node_wait_flag(np, RC_NODE_DYING)) { + (void) pthread_mutex_unlock(&np-> + rn_lock); + rc_node_clear(out, 1); + return (REP_PROTOCOL_FAIL_DELETED); + } } else { rc_node_t *cpg; @@ -6557,9 +6566,21 @@ case REP_PROTOCOL_FAIL_TYPE_MISMATCH: /* Nevermind. */ + (void) pthread_mutex_unlock(&np-> + rn_lock); rc_node_destroy(cpg); rc_node_rele(pg); rc_node_rele(res); + (void) pthread_mutex_lock(&np-> + rn_lock); + if (!rc_node_wait_flag(np, + RC_NODE_DYING)) { + (void) pthread_mutex_unlock(& + np->rn_lock); + rc_node_clear(out, 1); + return + (REP_PROTOCOL_FAIL_DELETED); + } break; case REP_PROTOCOL_FAIL_NO_RESOURCES: