Re: [NFS] attempt to use V1 mount protocol on V3 server

From: Trond Myklebust
Date: Thu Sep 04 2003 - 10:26:08 EST


>>>>> " " == Pascal Schmidt <der.eremit@xxxxxxxx> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/