aboutsummaryrefslogtreecommitdiff
path: root/sys/rpc
diff options
context:
space:
mode:
authorRick Macklem <rmacklem@FreeBSD.org>2019-04-02 23:51:08 +0000
committerRick Macklem <rmacklem@FreeBSD.org>2019-04-02 23:51:08 +0000
commitb0e14530a026f2529bd8dd7198066544d2eff331 (patch)
tree6530a26058da445aaa0b8a34ae413788a7535c04 /sys/rpc
parent154c6ffd71a214d46deb272f0ab458149cece30c (diff)
Notes
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/rpcsec_gss/svc_rpcsec_gss.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
index 613b686b2334..91d07a84dd05 100644
--- a/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
+++ b/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
@@ -568,19 +568,13 @@ svc_rpc_gss_create_client(void)
client = mem_alloc(sizeof(struct svc_rpc_gss_client));
memset(client, 0, sizeof(struct svc_rpc_gss_client));
- refcount_init(&client->cl_refs, 1);
+ refcount_init(&client->cl_refs, 2);
sx_init(&client->cl_lock, "GSS-client");
getcredhostid(curthread->td_ucred, &hostid);
client->cl_id.ci_hostid = hostid;
getboottime(&boottime);
client->cl_id.ci_boottime = boottime.tv_sec;
client->cl_id.ci_id = svc_rpc_gss_next_clientid++;
- list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size];
- sx_xlock(&svc_rpc_gss_lock);
- TAILQ_INSERT_HEAD(list, client, cl_link);
- TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink);
- svc_rpc_gss_client_count++;
- sx_xunlock(&svc_rpc_gss_lock);
/*
* Start the client off with a short expiration time. We will
@@ -590,6 +584,12 @@ svc_rpc_gss_create_client(void)
client->cl_locked = FALSE;
client->cl_expiration = time_uptime + 5*60;
+ list = &svc_rpc_gss_client_hash[client->cl_id.ci_id % svc_rpc_gss_client_hash_size];
+ sx_xlock(&svc_rpc_gss_lock);
+ TAILQ_INSERT_HEAD(list, client, cl_link);
+ TAILQ_INSERT_HEAD(&svc_rpc_gss_clients, client, cl_alllink);
+ svc_rpc_gss_client_count++;
+ sx_xunlock(&svc_rpc_gss_lock);
return (client);
}
@@ -1287,7 +1287,6 @@ svc_rpc_gss(struct svc_req *rqst, struct rpc_msg *msg)
goto out;
}
client = svc_rpc_gss_create_client();
- refcount_acquire(&client->cl_refs);
} else {
struct svc_rpc_gss_clientid *p;
if (gc.gc_handle.length != sizeof(*p)) {