summaryrefslogtreecommitdiff
path: root/usr/src/lib/libnsl/rpc/clnt_vc.c
diff options
context:
space:
mode:
authorevanl <none@none>2006-10-13 12:08:49 -0700
committerevanl <none@none>2006-10-13 12:08:49 -0700
commit8f379ff8b85682de48eecc7df2eb8a2db96e852f (patch)
tree90f8095874ff768991ed5fb162079a0c31f52310 /usr/src/lib/libnsl/rpc/clnt_vc.c
parent92f381329ebf1c2209df9608670666b32b291e05 (diff)
downloadillumos-joyent-8f379ff8b85682de48eecc7df2eb8a2db96e852f.tar.gz
6474978 hung rpc calls cause automounter to hang
6475460 The automounter is file descriptor challenged
Diffstat (limited to 'usr/src/lib/libnsl/rpc/clnt_vc.c')
-rw-r--r--usr/src/lib/libnsl/rpc/clnt_vc.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/usr/src/lib/libnsl/rpc/clnt_vc.c b/usr/src/lib/libnsl/rpc/clnt_vc.c
index 6e72e821a7..42d5246ebe 100644
--- a/usr/src/lib/libnsl/rpc/clnt_vc.c
+++ b/usr/src/lib/libnsl/rpc/clnt_vc.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -21,7 +20,7 @@
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
@@ -250,6 +249,12 @@ _clnt_vc_create_timed(int fd, struct netbuf *svcaddr, rpcprog_t prog,
}
ct->ct_addr.buf = NULL;
+ /*
+ * The only use of vctbl_lock is for serializing the creation of
+ * vctbl. Once created the lock needs to be released so we don't
+ * hold it across the set_up_connection() call and end up with a
+ * bunch of threads stuck waiting for the mutex.
+ */
sig_mutex_lock(&vctbl_lock);
if ((vctbl == NULL) && ((vctbl = rpc_fd_init()) == NULL)) {
@@ -260,6 +265,8 @@ _clnt_vc_create_timed(int fd, struct netbuf *svcaddr, rpcprog_t prog,
goto err;
}
+ sig_mutex_unlock(&vctbl_lock);
+
ct->ct_io_mode = RPC_CL_BLOCKING;
ct->ct_blocking_mode = RPC_CL_BLOCKING_FLUSH;
@@ -276,16 +283,13 @@ _clnt_vc_create_timed(int fd, struct netbuf *svcaddr, rpcprog_t prog,
rpc_createerr.cf_stat = RPC_SYSTEMERROR;
rpc_createerr.cf_error.re_terrno = errno;
rpc_createerr.cf_error.re_errno = 0;
- sig_mutex_unlock(&vctbl_lock);
goto err;
}
ct->ct_is_blocking = flag & O_NONBLOCK ? FALSE : TRUE;
if (set_up_connection(fd, svcaddr, ct, tp) == FALSE) {
- sig_mutex_unlock(&vctbl_lock);
goto err;
}
- sig_mutex_unlock(&vctbl_lock);
/*
* Set up other members of private data struct