Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159169362
D57455.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D57455.diff
View Options
diff --git a/sys/kgssapi/gss_impl.c.sav b/sys/kgssapi/gss_impl.c
--- a/sys/kgssapi/gss_impl.c.sav
+++ b/sys/kgssapi/gss_impl.c
@@ -52,6 +52,7 @@
struct mtx kgss_gssd_lock;
CLIENT *kgss_gssd_handle;
+CLIENT *kgss_gssd_cl;
static int
kgss_load(void)
@@ -79,7 +80,7 @@
clnt_control(cl, CLSET_WAITCHAN, "gssd");
mtx_lock(&kgss_gssd_lock);
- kgss_gssd_handle = cl;
+ kgss_gssd_cl = cl;
mtx_unlock(&kgss_gssd_lock);
return (0);
@@ -90,7 +91,7 @@
kgss_unload(void)
{
- clnt_destroy(kgss_gssd_handle);
+ clnt_destroy(kgss_gssd_cl);
}
#endif
@@ -237,9 +238,41 @@
kgss_gssd_client(void)
{
CLIENT *cl;
+ struct rpc_callextra ext;
+ enum clnt_stat stat;
+ struct timeval nulltimo = {.tv_sec = 0, .tv_usec = 200000}, savtimo;
+ static time_t nextrpc = 0;
mtx_lock(&kgss_gssd_lock);
cl = kgss_gssd_handle;
+ if (cl == NULL) {
+ cl = kgss_gssd_cl;
+ mtx_unlock(&kgss_gssd_lock);
+ if (cl == NULL)
+ return (cl);
+ if (time_uptime < nextrpc)
+ return (NULL);
+ /*
+ * Do a Null RPC with a short timeout. If the RPC succeeds,
+ * the gssd daemon is running. If the Null RPC fails, don't
+ * again for 5sec.
+ */
+ CLNT_CONTROL(cl, CLGET_TIMEOUT, &savtimo);
+ CLNT_CONTROL(cl, CLSET_TIMEOUT, &nulltimo);
+ memset(&ext, 0, sizeof(ext));
+ ext.rc_auth = authnone_create();
+ stat = clnt_call_private(cl, &ext, NULLPROC,
+ (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_void, NULL,
+ nulltimo); /* nulltimo is ignored by clnt_nl_call(). */
+ AUTH_DESTROY(ext.rc_auth);
+ if (stat != RPC_SUCCESS) {
+ nextrpc = time_uptime + 5;
+ return (NULL);
+ }
+ CLNT_CONTROL(cl, CLSET_TIMEOUT, &savtimo);
+ mtx_lock(&kgss_gssd_lock);
+ kgss_gssd_handle = cl;
+ }
if (cl != NULL)
CLNT_ACQUIRE(cl);
mtx_unlock(&kgss_gssd_lock);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jun 11, 9:23 PM (2 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33764807
Default Alt Text
D57455.diff (1 KB)
Attached To
Mode
D57455: gss_impl.c: Fix a nfsd hang when kgssapi.ko is loaded, but gssd not running
Attached
Detach File
Event Timeline
Log In to Comment