diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 13:16:20 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-06-22 16:07:04 -0400 |
commit | 5ee0ed7d3ab620a764740fb018f469d45f561931 (patch) | |
tree | 9b6a938fe521815afd3cfb42e2023b443bb05d28 /fs/lockd | |
parent | 5b616f5d596c0b056129f8aeafbc08409b3cd050 (diff) |
[PATCH] RPC: Make rpc_create_client() probe server for RPC program+version support
Ensure that we don't create an RPC client without checking that the server
does indeed support the RPC program + version that we are trying to set up.
This enables us to immediately return an error to "mount" if it turns out
that the server is only supporting NFSv2, when we requested NFSv3 or NFSv4.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd')
-rw-r--r-- | fs/lockd/host.c | 4 | ||||
-rw-r--r-- | fs/lockd/mon.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index 90a62f27914c..82c77df81c5f 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
@@ -189,6 +189,8 @@ nlm_bind_host(struct nlm_host *host) | |||
189 | goto forgetit; | 189 | goto forgetit; |
190 | 190 | ||
191 | xprt_set_timeout(&xprt->timeout, 5, nlmsvc_timeout); | 191 | xprt_set_timeout(&xprt->timeout, 5, nlmsvc_timeout); |
192 | xprt->nocong = 1; /* No congestion control for NLM */ | ||
193 | xprt->resvport = 1; /* NLM requires a reserved port */ | ||
192 | 194 | ||
193 | /* Existing NLM servers accept AUTH_UNIX only */ | 195 | /* Existing NLM servers accept AUTH_UNIX only */ |
194 | clnt = rpc_create_client(xprt, host->h_name, &nlm_program, | 196 | clnt = rpc_create_client(xprt, host->h_name, &nlm_program, |
@@ -196,8 +198,6 @@ nlm_bind_host(struct nlm_host *host) | |||
196 | if (IS_ERR(clnt)) | 198 | if (IS_ERR(clnt)) |
197 | goto forgetit; | 199 | goto forgetit; |
198 | clnt->cl_autobind = 1; /* turn on pmap queries */ | 200 | clnt->cl_autobind = 1; /* turn on pmap queries */ |
199 | xprt->nocong = 1; /* No congestion control for NLM */ | ||
200 | xprt->resvport = 1; /* NLM requires a reserved port */ | ||
201 | 201 | ||
202 | host->h_rpcclnt = clnt; | 202 | host->h_rpcclnt = clnt; |
203 | } | 203 | } |
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index 81b5e7778d70..2d144abe84ad 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c | |||
@@ -115,6 +115,7 @@ nsm_create(void) | |||
115 | xprt = xprt_create_proto(IPPROTO_UDP, &sin, NULL); | 115 | xprt = xprt_create_proto(IPPROTO_UDP, &sin, NULL); |
116 | if (IS_ERR(xprt)) | 116 | if (IS_ERR(xprt)) |
117 | return (struct rpc_clnt *)xprt; | 117 | return (struct rpc_clnt *)xprt; |
118 | xprt->resvport = 1; /* NSM requires a reserved port */ | ||
118 | 119 | ||
119 | clnt = rpc_create_client(xprt, "localhost", | 120 | clnt = rpc_create_client(xprt, "localhost", |
120 | &nsm_program, SM_VERSION, | 121 | &nsm_program, SM_VERSION, |
@@ -124,7 +125,6 @@ nsm_create(void) | |||
124 | clnt->cl_softrtry = 1; | 125 | clnt->cl_softrtry = 1; |
125 | clnt->cl_chatty = 1; | 126 | clnt->cl_chatty = 1; |
126 | clnt->cl_oneshot = 1; | 127 | clnt->cl_oneshot = 1; |
127 | xprt->resvport = 1; /* NSM requires a reserved port */ | ||
128 | return clnt; | 128 | return clnt; |
129 | 129 | ||
130 | out_err: | 130 | out_err: |