summaryrefslogtreecommitdiffstats
path: root/fs/nfs/client.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2023-06-07 09:59:42 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2023-06-19 12:29:23 -0400
commit6c0a8c5fcf7158e889dbdd077f67c81984704710 (patch)
tree0873944aa6decc72d2403bc0e6515e82a4b98b3e /fs/nfs/client.c
parent75eb6af7acdf566c68d61e98e67ee2f235201c02 (diff)
downloadlinux-6c0a8c5fcf7158e889dbdd077f67c81984704710.tar.gz
linux-6c0a8c5fcf7158e889dbdd077f67c81984704710.tar.bz2
linux-6c0a8c5fcf7158e889dbdd077f67c81984704710.zip
NFS: Have struct nfs_client carry a TLS policy field
The new field is used to match struct nfs_clients that have the same TLS policy setting. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/client.c')
-rw-r--r--fs/nfs/client.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index f50e025ae406..9bfdade0f6e6 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -184,6 +184,7 @@ struct nfs_client *nfs_alloc_client(const struct nfs_client_initdata *cl_init)
clp->cl_net = get_net(cl_init->net);
clp->cl_principal = "*";
+ clp->cl_xprtsec = cl_init->xprtsec;
return clp;
error_cleanup:
@@ -326,6 +327,10 @@ again:
sap))
continue;
+ /* Match the xprt security policy */
+ if (clp->cl_xprtsec.policy != data->xprtsec.policy)
+ continue;
+
refcount_inc(&clp->cl_count);
return clp;
}
@@ -675,6 +680,9 @@ static int nfs_init_server(struct nfs_server *server,
.cred = server->cred,
.nconnect = ctx->nfs_server.nconnect,
.init_flags = (1UL << NFS_CS_REUSEPORT),
+ .xprtsec = {
+ .policy = RPC_XPRTSEC_NONE,
+ },
};
struct nfs_client *clp;
int error;