From 6ab697caaefb599dda8c2839feec7322d7cf45bb Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Fri, 7 Feb 2014 22:43:52 +0100 Subject: [PATCH] 4584 assertion failed: hostp->nh_refs == 0, file: ../../common/klm/nlm_impl.c, line: 1135 Reviewed by: Alek Pinchuk Reviewed by: Gordon Ross Reviewed by: Gary Mills Approved by: Robert Mustacchi --- usr/src/uts/common/klm/nlm_impl.c | 15 +++++++++++---- 1 file 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); } -- 2.11.4.GIT