aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTigran Mkrtchyan <tigran.mkrtchyan@desy.de>2016-06-13 14:52:00 -0400
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-07-19 16:23:25 -0400
commitb224f7cb635f0a1a0a80c1dae93699a2a1161604 (patch)
tree80886c8dc02b7fa13fd58b76bf479c18ae154a99
parent3fc75f12089eab6bf3f5350a5f760f241060bd5d (diff)
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>
-rw-r--r--fs/nfs/internal.h2
-rw-r--r--fs/nfs/nfs3client.c6
-rw-r--r--fs/nfs/pnfs_nfs.c4
3 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index b257a2eaf92c..f7e33a5984d8 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -195,7 +195,7 @@ extern struct nfs_client *nfs4_set_ds_client(struct nfs_server *mds_srv,
195 rpc_authflavor_t au_flavor); 195 rpc_authflavor_t au_flavor);
196extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *, 196extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *,
197 struct inode *); 197 struct inode *);
198extern struct nfs_client *nfs3_set_ds_client(struct nfs_client *mds_clp, 198extern struct nfs_client *nfs3_set_ds_client(struct nfs_server *mds_srv,
199 const struct sockaddr *ds_addr, int ds_addrlen, 199 const struct sockaddr *ds_addr, int ds_addrlen,
200 int ds_proto, unsigned int ds_timeo, 200 int ds_proto, unsigned int ds_timeo,
201 unsigned int ds_retrans, rpc_authflavor_t au_flavor); 201 unsigned int ds_retrans, rpc_authflavor_t au_flavor);
diff --git a/fs/nfs/nfs3client.c b/fs/nfs/nfs3client.c
index 0457b4129421..ee753547fb0a 100644
--- a/fs/nfs/nfs3client.c
+++ b/fs/nfs/nfs3client.c
@@ -76,12 +76,13 @@ struct nfs_server *nfs3_clone_server(struct nfs_server *source,
76 * low timeout interval so that if a connection is lost, we retry through 76 * low timeout interval so that if a connection is lost, we retry through
77 * the MDS. 77 * the MDS.
78 */ 78 */
79struct nfs_client *nfs3_set_ds_client(struct nfs_client *mds_clp, 79struct nfs_client *nfs3_set_ds_client(struct nfs_server *mds_srv,
80 const struct sockaddr *ds_addr, int ds_addrlen, 80 const struct sockaddr *ds_addr, int ds_addrlen,
81 int ds_proto, unsigned int ds_timeo, unsigned int ds_retrans, 81 int ds_proto, unsigned int ds_timeo, unsigned int ds_retrans,
82 rpc_authflavor_t au_flavor) 82 rpc_authflavor_t au_flavor)
83{ 83{
84 struct rpc_timeout ds_timeout; 84 struct rpc_timeout ds_timeout;
85 struct nfs_client *mds_clp = mds_srv->nfs_client;
85 struct nfs_client_initdata cl_init = { 86 struct nfs_client_initdata cl_init = {
86 .addr = ds_addr, 87 .addr = ds_addr,
87 .addrlen = ds_addrlen, 88 .addrlen = ds_addrlen,
@@ -100,6 +101,9 @@ struct nfs_client *nfs3_set_ds_client(struct nfs_client *mds_clp,
100 return ERR_PTR(-EINVAL); 101 return ERR_PTR(-EINVAL);
101 cl_init.hostname = buf; 102 cl_init.hostname = buf;
102 103
104 if (mds_srv->flags & NFS_MOUNT_NORESVPORT)
105 set_bit(NFS_CS_NORESVPORT, &cl_init.init_flags);
106
103 /* Use the MDS nfs_client cl_ipaddr. */ 107 /* Use the MDS nfs_client cl_ipaddr. */
104 nfs_init_timeout_values(&ds_timeout, ds_proto, ds_timeo, ds_retrans); 108 nfs_init_timeout_values(&ds_timeout, ds_proto, ds_timeo, ds_retrans);
105 clp = nfs_get_client(&cl_init, au_flavor); 109 clp = nfs_get_client(&cl_init, au_flavor);
diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c
index 5856b2c66234..fe183fbc4b90 100644
--- a/fs/nfs/pnfs_nfs.c
+++ b/fs/nfs/pnfs_nfs.c
@@ -595,7 +595,7 @@ static void nfs4_clear_ds_conn_bit(struct nfs4_pnfs_ds *ds)
595} 595}
596 596
597static struct nfs_client *(*get_v3_ds_connect)( 597static struct nfs_client *(*get_v3_ds_connect)(
598 struct nfs_client *mds_clp, 598 struct nfs_server *mds_srv,
599 const struct sockaddr *ds_addr, 599 const struct sockaddr *ds_addr,
600 int ds_addrlen, 600 int ds_addrlen,
601 int ds_proto, 601 int ds_proto,
@@ -654,7 +654,7 @@ static int _nfs4_pnfs_v3_ds_connect(struct nfs_server *mds_srv,
654 rpc_clnt_add_xprt(clp->cl_rpcclient, &xprt_args, 654 rpc_clnt_add_xprt(clp->cl_rpcclient, &xprt_args,
655 rpc_clnt_test_and_add_xprt, NULL); 655 rpc_clnt_test_and_add_xprt, NULL);
656 } else 656 } else
657 clp = get_v3_ds_connect(mds_srv->nfs_client, 657 clp = get_v3_ds_connect(mds_srv,
658 (struct sockaddr *)&da->da_addr, 658 (struct sockaddr *)&da->da_addr,
659 da->da_addrlen, IPPROTO_TCP, 659 da->da_addrlen, IPPROTO_TCP,
660 timeo, retrans, au_flavor); 660 timeo, retrans, au_flavor);