@@ -896,7 +896,8 @@ static int nfs4_set_client(struct nfs_server *server,
896896 int proto , const struct rpc_timeout * timeparms ,
897897 u32 minorversion , unsigned int nconnect ,
898898 unsigned int max_connect ,
899- struct net * net )
899+ struct net * net ,
900+ struct xprtsec_parms * xprtsec )
900901{
901902 struct nfs_client_initdata cl_init = {
902903 .hostname = hostname ,
@@ -909,6 +910,7 @@ static int nfs4_set_client(struct nfs_server *server,
909910 .net = net ,
910911 .timeparms = timeparms ,
911912 .cred = server -> cred ,
913+ .xprtsec = * xprtsec ,
912914 };
913915 struct nfs_client * clp ;
914916
@@ -978,6 +980,7 @@ struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv,
978980 .net = mds_clp -> cl_net ,
979981 .timeparms = & ds_timeout ,
980982 .cred = mds_srv -> cred ,
983+ .xprtsec = mds_srv -> nfs_client -> cl_xprtsec ,
981984 };
982985 char buf [INET6_ADDRSTRLEN + 1 ];
983986
@@ -1127,6 +1130,9 @@ static int nfs4_server_common_setup(struct nfs_server *server,
11271130static int nfs4_init_server (struct nfs_server * server , struct fs_context * fc )
11281131{
11291132 struct nfs_fs_context * ctx = nfs_fc2context (fc );
1133+ struct xprtsec_parms xprtsec = {
1134+ .policy = RPC_XPRTSEC_NONE ,
1135+ };
11301136 struct rpc_timeout timeparms ;
11311137 int error ;
11321138
@@ -1157,7 +1163,8 @@ static int nfs4_init_server(struct nfs_server *server, struct fs_context *fc)
11571163 ctx -> minorversion ,
11581164 ctx -> nfs_server .nconnect ,
11591165 ctx -> nfs_server .max_connect ,
1160- fc -> net_ns );
1166+ fc -> net_ns ,
1167+ & xprtsec );
11611168 if (error < 0 )
11621169 return error ;
11631170
@@ -1247,7 +1254,8 @@ struct nfs_server *nfs4_create_referral_server(struct fs_context *fc)
12471254 parent_client -> cl_mvops -> minor_version ,
12481255 parent_client -> cl_nconnect ,
12491256 parent_client -> cl_max_connect ,
1250- parent_client -> cl_net );
1257+ parent_client -> cl_net ,
1258+ & parent_client -> cl_xprtsec );
12511259 if (!error )
12521260 goto init_server ;
12531261#endif /* IS_ENABLED(CONFIG_SUNRPC_XPRT_RDMA) */
@@ -1263,7 +1271,8 @@ struct nfs_server *nfs4_create_referral_server(struct fs_context *fc)
12631271 parent_client -> cl_mvops -> minor_version ,
12641272 parent_client -> cl_nconnect ,
12651273 parent_client -> cl_max_connect ,
1266- parent_client -> cl_net );
1274+ parent_client -> cl_net ,
1275+ & parent_client -> cl_xprtsec );
12671276 if (error < 0 )
12681277 goto error ;
12691278
@@ -1336,7 +1345,8 @@ int nfs4_update_server(struct nfs_server *server, const char *hostname,
13361345 error = nfs4_set_client (server , hostname , sap , salen , buf ,
13371346 clp -> cl_proto , clnt -> cl_timeout ,
13381347 clp -> cl_minorversion ,
1339- clp -> cl_nconnect , clp -> cl_max_connect , net );
1348+ clp -> cl_nconnect , clp -> cl_max_connect ,
1349+ net , & clp -> cl_xprtsec );
13401350 clear_bit (NFS_MIG_TSM_POSSIBLE , & server -> mig_status );
13411351 if (error != 0 ) {
13421352 nfs_server_insert_lists (server );
0 commit comments