mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
pnfs: Fix TLS logic in _nfs4_pnfs_v3_ds_connect()
Don't try to add an RDMA transport to a client that is already marked as
being a TCP/TLS transport.
Fixes: 04a1526366 ("pnfs/flexfiles: connect to NFSv3 DS using TLS if MDS connection uses TLS")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
This commit is contained in:
committed by
Anna Schumaker
parent
e9a6fb0bcd
commit
7aca00d950
@@ -809,8 +809,11 @@ static int _nfs4_pnfs_v3_ds_connect(struct nfs_server *mds_srv,
|
||||
unsigned int retrans)
|
||||
{
|
||||
struct nfs_client *clp = ERR_PTR(-EIO);
|
||||
struct nfs_client *mds_clp = mds_srv->nfs_client;
|
||||
enum xprtsec_policies xprtsec_policy = mds_clp->cl_xprtsec.policy;
|
||||
struct nfs4_pnfs_ds_addr *da;
|
||||
unsigned long connect_timeout = timeo * (retrans + 1) * HZ / 10;
|
||||
int ds_proto;
|
||||
int status = 0;
|
||||
|
||||
dprintk("--> %s DS %s\n", __func__, ds->ds_remotestr);
|
||||
@@ -834,27 +837,28 @@ static int _nfs4_pnfs_v3_ds_connect(struct nfs_server *mds_srv,
|
||||
.xprtsec = clp->cl_xprtsec,
|
||||
};
|
||||
|
||||
if (da->da_transport != clp->cl_proto &&
|
||||
clp->cl_proto != XPRT_TRANSPORT_TCP_TLS)
|
||||
continue;
|
||||
if (da->da_transport == XPRT_TRANSPORT_TCP &&
|
||||
mds_srv->nfs_client->cl_proto == XPRT_TRANSPORT_TCP_TLS)
|
||||
if (xprt_args.ident == XPRT_TRANSPORT_TCP &&
|
||||
clp->cl_proto == XPRT_TRANSPORT_TCP_TLS)
|
||||
xprt_args.ident = XPRT_TRANSPORT_TCP_TLS;
|
||||
|
||||
if (da->da_addr.ss_family != clp->cl_addr.ss_family)
|
||||
if (xprt_args.ident != clp->cl_proto)
|
||||
continue;
|
||||
if (xprt_args.dstaddr->sa_family !=
|
||||
clp->cl_addr.ss_family)
|
||||
continue;
|
||||
/* Add this address as an alias */
|
||||
rpc_clnt_add_xprt(clp->cl_rpcclient, &xprt_args,
|
||||
rpc_clnt_test_and_add_xprt, NULL);
|
||||
rpc_clnt_test_and_add_xprt, NULL);
|
||||
continue;
|
||||
}
|
||||
if (da->da_transport == XPRT_TRANSPORT_TCP &&
|
||||
mds_srv->nfs_client->cl_proto == XPRT_TRANSPORT_TCP_TLS)
|
||||
da->da_transport = XPRT_TRANSPORT_TCP_TLS;
|
||||
clp = get_v3_ds_connect(mds_srv,
|
||||
&da->da_addr,
|
||||
da->da_addrlen, da->da_transport,
|
||||
timeo, retrans);
|
||||
|
||||
ds_proto = da->da_transport;
|
||||
if (ds_proto == XPRT_TRANSPORT_TCP &&
|
||||
xprtsec_policy != RPC_XPRTSEC_NONE)
|
||||
ds_proto = XPRT_TRANSPORT_TCP_TLS;
|
||||
|
||||
clp = get_v3_ds_connect(mds_srv, &da->da_addr, da->da_addrlen,
|
||||
ds_proto, timeo, retrans);
|
||||
if (IS_ERR(clp))
|
||||
continue;
|
||||
clp->cl_rpcclient->cl_softerr = 0;
|
||||
|
||||
Reference in New Issue
Block a user