Skip to contentSkip to conversation

NFS: try RPC_AUTH_GSS_KRB5 after RPC_AUTH_GSS_KRB5I for cl_rpcclient

PATCH New [email protected] 1 participant 2 messages Dec 17, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover NFS: try RPC_AUTH_GSS_KRB5 after RPC_AUTH_GSS_KRB5I for cl_rpcclient

From: Andy Adamson <[email protected]>

I'm not sure why in the -EACCES case for nfs4_discover_server_trunking, nfs4_root_machine_cred(clp) is called, and then retry the detect_trunking call.

Andy Adamson (1):
NFS: try RPC_AUTH_GSS_KRB5 after RPC_AUTH_GSS_KRB5I for cl_rpcclient

 fs/nfs/nfs4state.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 NFS: try RPC_AUTH_GSS_KRB5 after RPC_AUTH_GSS_KRB5I for cl_rpcclient

From: Andy Adamson <[email protected]>

Some servers implement KRB5 but not KRB5I. With out this patch, said servers will use AUTH_UNIX for state creation, even when exporting a volume with krb5.

---
 fs/nfs/nfs4state.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
fs/nfs/nfs4state.c +15 -0
index 5194933..a56ad3f 100644
@@ -2063,6 +2063,21 @@ again:
 			nfs4_root_machine_cred(clp);
 			goto again;
 		}
+		if (clnt->cl_auth->au_flavor == RPC_AUTH_GSS_KRB5I) {
+			clnt = rpc_clone_client_set_auth(clnt, RPC_AUTH_GSS_KRB5);
+			if (IS_ERR(clnt)) {
+				status = PTR_ERR(clnt);
+				break;
+			}
+			/* Note: this is safe because we haven't yet marked the
+			 * client as ready, so we are the only user of
+			 * clp->cl_rpcclient
+			 */
+			clnt = xchg(&clp->cl_rpcclient, clnt);
+			rpc_shutdown_client(clnt);
+			clnt = clp->cl_rpcclient;
+			goto again;
+		}
 		if (clnt->cl_auth->au_flavor == RPC_AUTH_UNIX)
 			break;
 	case -NFS4ERR_CLID_INUSE:
Signature · 1 line
1.8.3.1