Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Chuck Lever and committed by
Trond Myklebust
6c0a8c5f 75eb6af7

+27 -6
+8
fs/nfs/client.c
··· 184 184 clp->cl_net = get_net(cl_init->net); 185 185 186 186 clp->cl_principal = "*"; 187 + clp->cl_xprtsec = cl_init->xprtsec; 187 188 return clp; 188 189 189 190 error_cleanup: ··· 326 325 !rpc_clnt_xprt_switch_has_addr(clp->cl_rpcclient, 327 326 sap)) 328 327 continue; 328 + 329 + /* Match the xprt security policy */ 330 + if (clp->cl_xprtsec.policy != data->xprtsec.policy) 331 + continue; 329 332 330 333 refcount_inc(&clp->cl_count); 331 334 return clp; ··· 680 675 .cred = server->cred, 681 676 .nconnect = ctx->nfs_server.nconnect, 682 677 .init_flags = (1UL << NFS_CS_REUSEPORT), 678 + .xprtsec = { 679 + .policy = RPC_XPRTSEC_NONE, 680 + }, 683 681 }; 684 682 struct nfs_client *clp; 685 683 int error;
+1
fs/nfs/internal.h
··· 81 81 struct net *net; 82 82 const struct rpc_timeout *timeparms; 83 83 const struct cred *cred; 84 + struct xprtsec_parms xprtsec; 84 85 }; 85 86 86 87 /*
+1
fs/nfs/nfs3client.c
··· 93 93 .net = mds_clp->cl_net, 94 94 .timeparms = &ds_timeout, 95 95 .cred = mds_srv->cred, 96 + .xprtsec = mds_clp->cl_xprtsec, 96 97 }; 97 98 struct nfs_client *clp; 98 99 char buf[INET6_ADDRSTRLEN + 1];
+15 -5
fs/nfs/nfs4client.c
··· 896 896 int proto, const struct rpc_timeout *timeparms, 897 897 u32 minorversion, unsigned int nconnect, 898 898 unsigned int max_connect, 899 - struct net *net) 899 + struct net *net, 900 + struct xprtsec_parms *xprtsec) 900 901 { 901 902 struct nfs_client_initdata cl_init = { 902 903 .hostname = hostname, ··· 910 909 .net = net, 911 910 .timeparms = timeparms, 912 911 .cred = server->cred, 912 + .xprtsec = *xprtsec, 913 913 }; 914 914 struct nfs_client *clp; 915 915 ··· 980 978 .net = mds_clp->cl_net, 981 979 .timeparms = &ds_timeout, 982 980 .cred = mds_srv->cred, 981 + .xprtsec = mds_srv->nfs_client->cl_xprtsec, 983 982 }; 984 983 char buf[INET6_ADDRSTRLEN + 1]; 985 984 ··· 1130 1127 static int nfs4_init_server(struct nfs_server *server, struct fs_context *fc) 1131 1128 { 1132 1129 struct nfs_fs_context *ctx = nfs_fc2context(fc); 1130 + struct xprtsec_parms xprtsec = { 1131 + .policy = RPC_XPRTSEC_NONE, 1132 + }; 1133 1133 struct rpc_timeout timeparms; 1134 1134 int error; 1135 1135 ··· 1163 1157 ctx->minorversion, 1164 1158 ctx->nfs_server.nconnect, 1165 1159 ctx->nfs_server.max_connect, 1166 - fc->net_ns); 1160 + fc->net_ns, 1161 + &xprtsec); 1167 1162 if (error < 0) 1168 1163 return error; 1169 1164 ··· 1254 1247 parent_client->cl_mvops->minor_version, 1255 1248 parent_client->cl_nconnect, 1256 1249 parent_client->cl_max_connect, 1257 - parent_client->cl_net); 1250 + parent_client->cl_net, 1251 + &parent_client->cl_xprtsec); 1258 1252 if (!error) 1259 1253 goto init_server; 1260 1254 #endif /* IS_ENABLED(CONFIG_SUNRPC_XPRT_RDMA) */ ··· 1271 1263 parent_client->cl_mvops->minor_version, 1272 1264 parent_client->cl_nconnect, 1273 1265 parent_client->cl_max_connect, 1274 - parent_client->cl_net); 1266 + parent_client->cl_net, 1267 + &parent_client->cl_xprtsec); 1275 1268 if (error < 0) 1276 1269 goto error; 1277 1270 ··· 1345 1336 error = nfs4_set_client(server, hostname, sap, salen, buf, 1346 1337 clp->cl_proto, clnt->cl_timeout, 1347 1338 clp->cl_minorversion, 1348 - clp->cl_nconnect, clp->cl_max_connect, net); 1339 + clp->cl_nconnect, clp->cl_max_connect, 1340 + net, &clp->cl_xprtsec); 1349 1341 clear_bit(NFS_MIG_TSM_POSSIBLE, &server->mig_status); 1350 1342 if (error != 0) { 1351 1343 nfs_server_insert_lists(server);
+2 -1
include/linux/nfs_fs_sb.h
··· 63 63 u32 cl_minorversion;/* NFSv4 minorversion */ 64 64 unsigned int cl_nconnect; /* Number of connections */ 65 65 unsigned int cl_max_connect; /* max number of xprts allowed */ 66 - const char * cl_principal; /* used for machine cred */ 66 + const char * cl_principal; /* used for machine cred */ 67 + struct xprtsec_parms cl_xprtsec; /* xprt security policy */ 67 68 68 69 #if IS_ENABLED(CONFIG_NFS_V4) 69 70 struct list_head cl_ds_clients; /* auth flavor data servers */