Re: [patch 2/13] Return -ENOSYS for RPC programs that areunavailable

From: Trond Myklebust
Date: Tue Feb 15 2005 - 12:15:56 EST


No hacks in sunrpc, please: i.e. get rid of that NFSACL_PROGRAM
exception...
If you want to kill those warnings, please just convert them to
dprintks().

Also, why are you converting "unknown error" into ENOSYS?

Finally, it might make sense to distinguish between "program" and
"procedure" errors. How about converting that RPC_PROC_UNAVAIL error
into EOPNOTSUPP (like we already do in the NFS layer itself).

Cheers,
Trond

lau den 22.01.2005 Klokka 21:34 (+0100) skreiv Andreas Gruenbacher:
> vanlig tekstdokument vedlegg (patches.suse)
> 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@xxxxxxx>
> Signed-off-by: Olaf Kirch <okir@xxxxxxx>
>
> Index: linux-2.6.11-rc2/include/linux/nfs.h
> ===================================================================
> --- linux-2.6.11-rc2.orig/include/linux/nfs.h
> +++ linux-2.6.11-rc2/include/linux/nfs.h
> @@ -11,6 +11,7 @@
> #include <linux/string.h>
>
> #define NFS_PROGRAM 100003
> +#define NFSACL_PROGRAM 100227
> #define NFS_PORT 2049
> #define NFS_MAXDATA 8192
> #define NFS_MAXPATHLEN 1024
> Index: linux-2.6.11-rc2/net/sunrpc/clnt.c
> ===================================================================
> --- linux-2.6.11-rc2.orig/net/sunrpc/clnt.c
> +++ linux-2.6.11-rc2/net/sunrpc/clnt.c
> @@ -988,10 +988,12 @@ call_verify(struct rpc_task *task)
> break;
> case RPC_MISMATCH:
> printk(KERN_WARNING "%s: RPC call version mismatch!\n", __FUNCTION__);
> - goto out_eio;
> + error = -ENOSYS;
> + goto out_err;
> default:
> printk(KERN_WARNING "%s: RPC call rejected, unknown error: %x\n", __FUNCTION__, n);
> - goto out_eio;
> + error = -ENOSYS;
> + goto out_err;
> }
> if (--len < 0)
> goto out_overflow;
> @@ -1041,23 +1043,28 @@ 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",
> + if (task->tk_client->cl_prog != NFSACL_PROGRAM) {
> + 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;
> + }
> + 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 = -ENOSYS;
> + goto out_err;
> case RPC_GARBAGE_ARGS:
> dprintk("RPC: %4d %s: server saw garbage\n", task->tk_pid, __FUNCTION__);
> break; /* retry */
> @@ -1075,7 +1082,6 @@ out_retry:
> return NULL;
> }
> printk(KERN_WARNING "RPC %s: retry failed, exit EIO\n", __FUNCTION__);
> -out_eio:
> error = -EIO;
> out_err:
> rpc_exit(task, error);
>
> --
> Andreas Gruenbacher <agruen@xxxxxxx>
> SUSE Labs, SUSE LINUX PRODUCTS GMBH
>
--
Trond Myklebust <trond.myklebust@xxxxxxxxxx>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/