Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Apr 2019 03:50:16 +0000 (UTC)
From:      Rick Macklem <rmacklem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345828 - head/sys/rpc/rpcsec_gss
Message-ID:  <201904030350.x333oG3X030063@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904030350.x333oG3X030063>