summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/brand/lx/os/lx_lockd.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/usr/src/uts/common/brand/lx/os/lx_lockd.c b/usr/src/uts/common/brand/lx/os/lx_lockd.c
index d6d965398a..37b744b0e8 100644
--- a/usr/src/uts/common/brand/lx/os/lx_lockd.c
+++ b/usr/src/uts/common/brand/lx/os/lx_lockd.c
@@ -297,6 +297,18 @@ lx_upcall_statd(int op, struct nlm_globals *g, struct nlm_host *host)
* as we pass to monitor, so that is also handled here by this same
* brand hook.
*/
+
+ /*
+ * If the NLM was set up to be "v4 only" (i.e. no RPC call handlers
+ * to localhost at configure time), the semaphore is uninitialized,
+ * and will indefinitely hang. FURTHERMORE if just the semaphore
+ * was initialized, we'd still panic with a NULL nsm->ns_handle.
+ */
+ if (g->nlm_v4_only) {
+ stat = RPC_SYSTEMERROR;
+ goto bail;
+ }
+
nlm_netbuf_to_netobj(&host->nh_addr, &family, &obj);
nsm = &g->nlm_nsm;
@@ -327,6 +339,7 @@ lx_upcall_statd(int op, struct nlm_globals *g, struct nlm_host *host)
}
sema_v(&nsm->ns_sem);
+bail:
if (stat != RPC_SUCCESS) {
NLM_WARN("Failed to contact local statd, stat=%d", stat);
if (op == SM_MON) {