[PATCH] RPC: Return -EPFNOSUPPORT for RPC programs that are unavailable
authorAndreas Gruenbacher <agruen@suse.de>
Wed, 22 Jun 2005 17:16:23 +0000 (17:16 +0000)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 22 Jun 2005 20:07:17 +0000 (16:07 -0400)
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/clnt.c

index 9da1deb482e2c6396813f7f45233e6e434ec543c..33f12b84e265fd760a57feff789a52d795e824c2 100644 (file)
@@ -1021,10 +1021,11 @@ call_verify(struct rpc_task *task)
                        case RPC_AUTH_ERROR:
                                break;
                        case RPC_MISMATCH:
-                               printk(KERN_WARNING "%s: RPC call version mismatch!\n", __FUNCTION__);
-                               goto out_eio;
+                               dprintk("%s: RPC call version mismatch!\n", __FUNCTION__);
+                               error = -EPROTONOSUPPORT;
+                               goto out_err;
                        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;
                }
                if (--len < 0)
@@ -1075,23 +1076,26 @@ call_verify(struct rpc_task *task)
        case RPC_SUCCESS:
                return p;
        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,
                                task->tk_client->cl_server);
-               goto out_eio;
+               error = -EPFNOSUPPORT;
+               goto out_err;
        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_vers,
                                task->tk_client->cl_server);
-               goto out_eio;
+               error = -EPROTONOSUPPORT;
+               goto out_err;
        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_client->cl_prog,
                                task->tk_client->cl_vers,
                                task->tk_client->cl_server);
-               goto out_eio;
+               error = -EOPNOTSUPP;
+               goto out_err;
        case RPC_GARBAGE_ARGS:
                dprintk("RPC: %4d %s: server saw garbage\n", task->tk_pid, __FUNCTION__);
                break;                  /* retry */
@@ -1104,7 +1108,7 @@ out_retry:
        task->tk_client->cl_stats->rpcgarbage++;
        if (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;
                return NULL;
        }