Commit 906462af authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust

SUNRPC: Split another new rpcbind retry error code from EACCES

Add more new error code processing to the kernel's rpcbind client
and to call_bind_status() to distinguish two cases:

Case 1: the remote has replied that the program/version tuple is not
registered (returns EACCES)

Case 2: retry with a lesser rpcbind version (rpcb now returns EPFNOSUPPORT)

This change allows more specific error processing for each of these two
cases.  We now fail case 2 instead of retrying... it's a server
configuration error not to support even rpcbind version 2.  And don't
expose this new error code to user land -- convert it to EIO before
failing the RPC.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 2429cbf6
...@@ -940,7 +940,7 @@ call_bind(struct rpc_task *task) ...@@ -940,7 +940,7 @@ call_bind(struct rpc_task *task)
static void static void
call_bind_status(struct rpc_task *task) call_bind_status(struct rpc_task *task)
{ {
int status = -EACCES; int status = -EIO;
if (task->tk_status >= 0) { if (task->tk_status >= 0) {
dprint_status(task); dprint_status(task);
...@@ -966,6 +966,7 @@ call_bind_status(struct rpc_task *task) ...@@ -966,6 +966,7 @@ call_bind_status(struct rpc_task *task)
task->tk_pid); task->tk_pid);
goto retry_timeout; goto retry_timeout;
case -EPFNOSUPPORT: case -EPFNOSUPPORT:
/* server doesn't support any rpcbind version we know of */
dprintk("RPC: %5u remote rpcbind service unavailable\n", dprintk("RPC: %5u remote rpcbind service unavailable\n",
task->tk_pid); task->tk_pid);
break; break;
...@@ -978,7 +979,6 @@ call_bind_status(struct rpc_task *task) ...@@ -978,7 +979,6 @@ call_bind_status(struct rpc_task *task)
default: default:
dprintk("RPC: %5u unrecognized rpcbind error (%d)\n", dprintk("RPC: %5u unrecognized rpcbind error (%d)\n",
task->tk_pid, -task->tk_status); task->tk_pid, -task->tk_status);
status = -EIO;
} }
rpc_exit(task, status); rpc_exit(task, status);
......
...@@ -377,7 +377,7 @@ void rpcb_getport_async(struct rpc_task *task) ...@@ -377,7 +377,7 @@ void rpcb_getport_async(struct rpc_task *task)
} }
if (info[xprt->bind_index].rpc_proc == NULL) { if (info[xprt->bind_index].rpc_proc == NULL) {
xprt->bind_index = 0; xprt->bind_index = 0;
status = -EACCES; /* tell caller to try again later */ status = -EPFNOSUPPORT;
dprintk("RPC: %5u %s: no more getport versions available\n", dprintk("RPC: %5u %s: no more getport versions available\n",
task->tk_pid, __FUNCTION__); task->tk_pid, __FUNCTION__);
goto bailout_nofree; goto bailout_nofree;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment