
From: Andreas Gruenbacher <agruen@suse.de>

The issuer of an RPC call should be able to tell the difference between an I/O
error and program unavailable / program version unavailable / procedure
unavailable.  Return -ENOSYS for unavailable RPCs instead of -EIO.

Only issue a program unavailable warning for program numbers other than the
one for nfsacl: Clients with nfsacl support are quite common already; no need
to clutter the syslog.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/net/sunrpc/clnt.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff -puN net/sunrpc/clnt.c~nfsacl-return-enosys-for-rpc-programs-that-are-unavailable net/sunrpc/clnt.c
--- 25/net/sunrpc/clnt.c~nfsacl-return-enosys-for-rpc-programs-that-are-unavailable	2005-02-28 16:17:45.000000000 -0800
+++ 25-akpm/net/sunrpc/clnt.c	2005-02-28 16:17:45.000000000 -0800
@@ -1041,23 +1041,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",
-				(unsigned int)task->tk_client->cl_prog,
-				task->tk_client->cl_server);
-		goto out_eio;
+		dprintk(KERN_WARNING "RPC: call_verify: program %u is unsupported by server %s\n",
+			(unsigned int)task->tk_client->cl_prog,
+			task->tk_client->cl_server);
+		error = -ENOSYS;
+		goto out_err;
 	case RPC_PROG_MISMATCH:
 		printk(KERN_WARNING "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 = -ENOSYS;
+		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",
 				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 */
_
