Messages in this thread Patch in this message | | | Date | Thu, 4 Sep 2003 11:24:57 -0400 | Subject | Re: [NFS] attempt to use V1 mount protocol on V3 server | From | Trond Myklebust <> |
| |
>>>>> " " == Pascal Schmidt <der.eremit@email.de> writes:
> Fine with me if a buggy server results in a failure to > mount. However, I was seeing crashes.
I assume that your server's RPC engine replying with a PROG_MISMATCH the way it should when it cannot support NFSv2?
Hmm.. Looking at the code, we appear not to be handling that case very well in the RPC client. PROG_UNAVAIL, PROG_MISMATCH, and PROC_UNAVAIL are all handled incorrectly as if the replies were garbage...
Althought this is harmless, we should really be returning an EIO immediately, and report the error in the syslog...
Does the following patch (against 2.4.22) help?
Cheers, Trond
--- linux-2.4.22-up/net/sunrpc/clnt.c.orig 2003-08-23 14:11:09.000000000 -0400 +++ linux-2.4.22-up/net/sunrpc/clnt.c 2003-09-04 11:21:28.000000000 -0400 @@ -932,6 +932,24 @@ switch ((n = ntohl(*p++))) { case RPC_SUCCESS: return p; + case RPC_PROG_UNAVAIL: + printk(KERN_WARNING "RPC: %4d call_verify: program %u is unsupported by server %s\n", + task->tk_pid, (unsigned int)task->tk_client->cl_prog, + task->tk_client->cl_server); + goto out_eio; + case RPC_PROG_MISMATCH: + printk(KERN_WARNING "RPC: %4d call_verify: program %u, version %u unsupported by server %s\n", + task->tk_pid, (unsigned int)task->tk_client->cl_prog, + (unsigned int)task->tk_client->cl_vers, + task->tk_client->cl_server); + goto out_eio; + case RPC_PROC_UNAVAIL: + printk(KERN_WARNING "RPC: %4d call_verify: proc %u unsupported by program %u, version %u on server %s\n", + task->tk_pid, (unsigned int)task->tk_msg.rpc_proc, + (unsigned int)task->tk_client->cl_prog, + (unsigned int)task->tk_client->cl_vers, + task->tk_client->cl_server); + goto out_eio; case RPC_GARBAGE_ARGS: break; /* retry */ default: @@ -949,6 +967,7 @@ return NULL; } printk(KERN_WARNING "RPC: garbage, exit EIO\n"); +out_eio: rpc_exit(task, -EIO); return NULL; } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |