mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Pascal Schmidt <der.eremit@email.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [NFS] attempt to use V1 mount protocol on V3 server
Date: Thu, 4 Sep 2003 11:24:57 -0400	[thread overview]
Message-ID: <16215.22857.654633.466244@charged.uio.no> (raw)
In-Reply-To: <Pine.LNX.4.44.0309041621180.989-100000@neptune.local>

>>>>> " " == 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;
 }

  reply	other threads:[~2003-09-04 15:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <rO94.822.25@gated-at.bofh.it>
     [not found] ` <rPop.1vp.13@gated-at.bofh.it>
2003-09-04  2:08   ` Pascal Schmidt
2003-09-04  2:17     ` Trond Myklebust
2003-09-04  2:40       ` Pascal Schmidt
2003-09-04  4:37         ` Trond Myklebust
2003-09-04 14:27           ` Pascal Schmidt
2003-09-04 15:24             ` Trond Myklebust [this message]
2003-09-03 22:13 Pascal Schmidt
2003-09-03 23:33 ` Trond Myklebust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16215.22857.654633.466244@charged.uio.no \
    --to=trond.myklebust@fys.uio.no \
    --cc=der.eremit@email.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®