Skip to content

Commit b224f7c

Browse files
kofemanntrondmypd
authored andcommitted
nfs4: flexfiles: respect noresvport when establishing connections to DSes
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
1 parent 3fc75f1 commit b224f7c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

fs/nfs/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ extern struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv,
195195
rpc_authflavor_t au_flavor);
196196
extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *,
197197
struct inode *);
198-
extern struct nfs_client *nfs3_set_ds_client(struct nfs_client *mds_clp,
198+
extern struct nfs_client *nfs3_set_ds_client(struct nfs_server *mds_srv,
199199
const struct sockaddr *ds_addr, int ds_addrlen,
200200
int ds_proto, unsigned int ds_timeo,
201201
unsigned int ds_retrans, rpc_authflavor_t au_flavor);

fs/nfs/nfs3client.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ struct nfs_server *nfs3_clone_server(struct nfs_server *source,
7676
* low timeout interval so that if a connection is lost, we retry through
7777
* the MDS.
7878
*/
79-
struct nfs_client *nfs3_set_ds_client(struct nfs_client *mds_clp,
79+
struct nfs_client *nfs3_set_ds_client(struct nfs_server *mds_srv,
8080
const struct sockaddr *ds_addr, int ds_addrlen,
8181
int ds_proto, unsigned int ds_timeo, unsigned int ds_retrans,
8282
rpc_authflavor_t au_flavor)
8383
{
8484
struct rpc_timeout ds_timeout;
85+
struct nfs_client *mds_clp = mds_srv->nfs_client;
8586
struct nfs_client_initdata cl_init = {
8687
.addr = ds_addr,
8788
.addrlen = ds_addrlen,
@@ -100,6 +101,9 @@ struct nfs_client *nfs3_set_ds_client(struct nfs_client *mds_clp,
100101
return ERR_PTR(-EINVAL);
101102
cl_init.hostname = buf;
102103

104+
if (mds_srv->flags & NFS_MOUNT_NORESVPORT)
105+
set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags);
106+
103107
/* Use the MDS nfs_client cl_ipaddr. */
104108
nfs_init_timeout_values(&ds_timeout, ds_proto, ds_timeo, ds_retrans);
105109
clp = nfs_get_client(&cl_init, au_flavor);

fs/nfs/pnfs_nfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ static void nfs4_clear_ds_conn_bit(struct nfs4_pnfs_ds *ds)
595595
}
596596

597597
static struct nfs_client *(*get_v3_ds_connect)(
598-
struct nfs_client *mds_clp,
598+
struct nfs_server *mds_srv,
599599
const struct sockaddr *ds_addr,
600600
int ds_addrlen,
601601
int ds_proto,
@@ -654,7 +654,7 @@ static int _nfs4_pnfs_v3_ds_connect(struct nfs_server *mds_srv,
654654
rpc_clnt_add_xprt(clp->cl_rpcclient, &xprt_args,
655655
rpc_clnt_test_and_add_xprt, NULL);
656656
} else
657-
clp = get_v3_ds_connect(mds_srv->nfs_client,
657+
clp = get_v3_ds_connect(mds_srv,
658658
(struct sockaddr *)&da->da_addr,
659659
da->da_addrlen, IPPROTO_TCP,
660660
timeo, retrans, au_flavor);

0 commit comments

Comments
 (0)