summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Telka <marcel.telka@nexenta.com>2014-02-07 22:43:52 +0100
committerRobert Mustacchi <rm@joyent.com>2014-02-13 14:54:47 -0800
commit6ab697caaefb599dda8c2839feec7322d7cf45bb (patch)
tree7e6e43bd34ca0a43307966516c4ce4fad6604090
parent484ad3ba6a529a2471a98577d59d8ed49c7dd2c7 (diff)
downloadillumos-joyent-6ab697caaefb599dda8c2839feec7322d7cf45bb.tar.gz
4584 assertion failed: hostp->nh_refs == 0, file: ../../common/klm/nlm_impl.c, line: 1135
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com> Reviewed by: Gordon Ross <gordon.ross@nexenta.com> Reviewed by: Gary Mills <gary_mills@fastmail.fm> Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r--usr/src/uts/common/klm/nlm_impl.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/usr/src/uts/common/klm/nlm_impl.c b/usr/src/uts/common/klm/nlm_impl.c
index dd2418c741..7daa30dcb3 100644
--- a/usr/src/uts/common/klm/nlm_impl.c
+++ b/usr/src/uts/common/klm/nlm_impl.c
@@ -26,8 +26,8 @@
*/
/*
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
*/
/*
@@ -1608,7 +1608,7 @@ out:
/*
* Find or create an NLM host for the given name and address.
*
- * The remote host is determined by all of: name, netidd, address.
+ * The remote host is determined by all of: name, netid, address.
* Note that the netid is whatever nlm_svc_add_ep() gave to
* svc_tli_kcreate() for the service binding. If any of these
* are different, allocate a new host (new sysid).
@@ -1658,7 +1658,7 @@ nlm_host_findcreate(struct nlm_globals *g, char *name,
avl_insert(&g->nlm_hosts_tree, host, where);
/*
- * Insert host ot the hosts hash table that is
+ * Insert host to the hosts hash table that is
* used to lookup host by sysid.
*/
VERIFY(mod_hash_insert(g->nlm_hosts_hash,
@@ -1669,8 +1669,15 @@ nlm_host_findcreate(struct nlm_globals *g, char *name,
mutex_exit(&g->lock);
out:
- if (newhost != NULL)
+ if (newhost != NULL) {
+ /*
+ * We do not need the preallocated nlm_host
+ * so decrement the reference counter
+ * and destroy it.
+ */
+ newhost->nh_refs--;
nlm_host_destroy(newhost);
+ }
return (host);
}