751f52f
Bugzilla: N/A
751f52f
Upstream-status: sent for 3.14
751f52f
751f52f
From 6aa23d76a7b549521a03b63b6d5b7880ea87eab7 Mon Sep 17 00:00:00 2001
751f52f
From: Jeff Layton <jlayton@redhat.com>
751f52f
Date: Thu, 14 Nov 2013 07:25:19 -0500
751f52f
Subject: [PATCH] nfs: check if gssd is running before attempting to use krb5i
751f52f
 auth in SETCLIENTID call
751f52f
751f52f
Currently, the client will attempt to use krb5i in the SETCLIENTID call
751f52f
even if rpc.gssd isn't running. When that fails, it'll then fall back to
751f52f
RPC_AUTH_UNIX. This introduced a delay when mounting if rpc.gssd isn't
751f52f
running, and causes warning messages to pop up in the ring buffer.
751f52f
751f52f
Check to see if rpc.gssd is running before even attempting to use krb5i
751f52f
auth, and just silently skip trying to do so if it isn't. In the event
751f52f
that the admin is actually trying to mount with krb5*, it will still
751f52f
fail at a later stage of the mount attempt.
751f52f
751f52f
Signed-off-by: Jeff Layton <jlayton@redhat.com>
751f52f
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
751f52f
---
751f52f
 fs/nfs/nfs4client.c | 7 ++++++-
751f52f
 1 file changed, 6 insertions(+), 1 deletion(-)
751f52f
751f52f
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
751f52f
index b4a160a..c1b7a80 100644
751f52f
--- a/fs/nfs/nfs4client.c
751f52f
+++ b/fs/nfs/nfs4client.c
751f52f
@@ -10,6 +10,7 @@
751f52f
 #include <linux/sunrpc/auth.h>
751f52f
 #include <linux/sunrpc/xprt.h>
751f52f
 #include <linux/sunrpc/bc_xprt.h>
751f52f
+#include <linux/sunrpc/rpc_pipe_fs.h>
751f52f
 #include "internal.h"
751f52f
 #include "callback.h"
751f52f
 #include "delegation.h"
751f52f
@@ -370,7 +371,11 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp,
751f52f
 		__set_bit(NFS_CS_INFINITE_SLOTS, &clp->cl_flags);
751f52f
 	__set_bit(NFS_CS_DISCRTRY, &clp->cl_flags);
751f52f
 	__set_bit(NFS_CS_NO_RETRANS_TIMEOUT, &clp->cl_flags);
751f52f
-	error = nfs_create_rpc_client(clp, timeparms, RPC_AUTH_GSS_KRB5I);
751f52f
+
751f52f
+	error = -EINVAL;
751f52f
+	if (gssd_running(clp->cl_net))
751f52f
+		error = nfs_create_rpc_client(clp, timeparms,
751f52f
+					      RPC_AUTH_GSS_KRB5I);
751f52f
 	if (error == -EINVAL)
751f52f
 		error = nfs_create_rpc_client(clp, timeparms, RPC_AUTH_UNIX);
751f52f
 	if (error < 0)
751f52f
-- 
751f52f
1.8.2.1
751f52f