提交 cdf47706 编写于 作者: A Andreas Gruenbacher 提交者: Trond Myklebust

[PATCH] RPC: Return -EPFNOSUPPORT for RPC programs that are unavailable

Signed-off-by: NAndreas Gruenbacher <agruen@suse.de>
Signed-off-by: NOlaf Kirch <okir@suse.de>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 6a19275a
...@@ -1021,10 +1021,11 @@ call_verify(struct rpc_task *task) ...@@ -1021,10 +1021,11 @@ call_verify(struct rpc_task *task)
case RPC_AUTH_ERROR: case RPC_AUTH_ERROR:
break; break;
case RPC_MISMATCH: case RPC_MISMATCH:
printk(KERN_WARNING "%s: RPC call version mismatch!\n", __FUNCTION__); dprintk("%s: RPC call version mismatch!\n", __FUNCTION__);
goto out_eio; error = -EPROTONOSUPPORT;
goto out_err;
default: default:
printk(KERN_WARNING "%s: RPC call rejected, unknown error: %x\n", __FUNCTION__, n); dprintk("%s: RPC call rejected, unknown error: %x\n", __FUNCTION__, n);
goto out_eio; goto out_eio;
} }
if (--len < 0) if (--len < 0)
...@@ -1075,23 +1076,26 @@ call_verify(struct rpc_task *task) ...@@ -1075,23 +1076,26 @@ call_verify(struct rpc_task *task)
case RPC_SUCCESS: case RPC_SUCCESS:
return p; return p;
case RPC_PROG_UNAVAIL: case RPC_PROG_UNAVAIL:
printk(KERN_WARNING "RPC: call_verify: program %u is unsupported by server %s\n", dprintk("RPC: call_verify: program %u is unsupported by server %s\n",
(unsigned int)task->tk_client->cl_prog, (unsigned int)task->tk_client->cl_prog,
task->tk_client->cl_server); task->tk_client->cl_server);
goto out_eio; error = -EPFNOSUPPORT;
goto out_err;
case RPC_PROG_MISMATCH: case RPC_PROG_MISMATCH:
printk(KERN_WARNING "RPC: call_verify: program %u, version %u unsupported by server %s\n", dprintk("RPC: call_verify: program %u, version %u unsupported by server %s\n",
(unsigned int)task->tk_client->cl_prog, (unsigned int)task->tk_client->cl_prog,
(unsigned int)task->tk_client->cl_vers, (unsigned int)task->tk_client->cl_vers,
task->tk_client->cl_server); task->tk_client->cl_server);
goto out_eio; error = -EPROTONOSUPPORT;
goto out_err;
case RPC_PROC_UNAVAIL: case RPC_PROC_UNAVAIL:
printk(KERN_WARNING "RPC: call_verify: proc %p unsupported by program %u, version %u on server %s\n", dprintk("RPC: call_verify: proc %p unsupported by program %u, version %u on server %s\n",
task->tk_msg.rpc_proc, task->tk_msg.rpc_proc,
task->tk_client->cl_prog, task->tk_client->cl_prog,
task->tk_client->cl_vers, task->tk_client->cl_vers,
task->tk_client->cl_server); task->tk_client->cl_server);
goto out_eio; error = -EOPNOTSUPP;
goto out_err;
case RPC_GARBAGE_ARGS: case RPC_GARBAGE_ARGS:
dprintk("RPC: %4d %s: server saw garbage\n", task->tk_pid, __FUNCTION__); dprintk("RPC: %4d %s: server saw garbage\n", task->tk_pid, __FUNCTION__);
break; /* retry */ break; /* retry */
...@@ -1104,7 +1108,7 @@ call_verify(struct rpc_task *task) ...@@ -1104,7 +1108,7 @@ call_verify(struct rpc_task *task)
task->tk_client->cl_stats->rpcgarbage++; task->tk_client->cl_stats->rpcgarbage++;
if (task->tk_garb_retry) { if (task->tk_garb_retry) {
task->tk_garb_retry--; task->tk_garb_retry--;
dprintk(KERN_WARNING "RPC %s: retrying %4d\n", __FUNCTION__, task->tk_pid); dprintk("RPC %s: retrying %4d\n", __FUNCTION__, task->tk_pid);
task->tk_action = call_bind; task->tk_action = call_bind;
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册