svn commit: r345828 - head/sys/rpc/rpcsec_gss
Rick Macklem
rmacklem at FreeBSD.org
Tue Sep 3 14:06:29 UTC 2019
Author: rmacklem
Date: Wed Apr 3 03:50:16 2019
New Revision: 345828
URL: https://svnweb.freebsd.org/changeset/base/345828
Log:
Add a comment to the r345818 patch to explain why cl_refs is initialized to 2.
PR: 235582
MFC after: 2 weeks
Modified:
head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
Modified: head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c
==============================================================================
--- head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Wed Apr 3 03:30:57 2019 (r345827)
+++ head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c Wed Apr 3 03:50:16 2019 (r345828)
@@ -568,6 +568,11 @@ svc_rpc_gss_create_client(void)
client = mem_alloc(sizeof(struct svc_rpc_gss_client));
memset(client, 0, sizeof(struct svc_rpc_gss_client));
+
+ /*
+ * Set the initial value of cl_refs to two. One for the caller
+ * and the other to hold onto the client structure until it expires.
+ */
refcount_init(&client->cl_refs, 2);
sx_init(&client->cl_lock, "GSS-client");
getcredhostid(curthread->td_ucred, &hostid);
More information about the svn-src-all
mailing list