All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan McGee <dpmcgee@gmail.com>
To: linux-nfs@vger.kernel.org
Cc: Dan McGee <dpmcgee@gmail.com>
Subject: [PATCH] showmount: try v3 before falling back to v1
Date: Mon,  4 Jan 2010 19:34:07 -0600	[thread overview]
Message-ID: <1262655247-16849-1-git-send-email-dpmcgee@gmail.com> (raw)

A lot of people don't have anything below v3 enabled, so showmount is
completely unusable. Try v3 {tcp, udp} first; if they don't work, fall back
to v1 {tcp, udp}; if those don't work then just fail as before.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---

First (and quick) attempt at a patch here for showmount. Let me know if you see
serious problems with it or the approach. It seemed relatively sane to me and
fixed my problems after brief testing.

See a report like this for some proof this is an issue in the wild:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557954

Thanks,

-Dan

 utils/showmount/showmount.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/utils/showmount/showmount.c b/utils/showmount/showmount.c
index 418e8b9..716c06d 100644
--- a/utils/showmount/showmount.c
+++ b/utils/showmount/showmount.c
@@ -96,6 +96,14 @@ static CLIENT *nfs_get_mount_client(const char *hostname)
 	rpcprog_t program = nfs_getrpcbyname(MOUNTPROG, nfs_sm_pgmtbl);
 	CLIENT *client;
 
+	client = clnt_create(hostname, program, MOUNTVERS_NFSV3, "tcp");
+	if (client)
+		return client;
+
+	client = clnt_create(hostname, program, MOUNTVERS_NFSV3, "udp");
+	if (client)
+		return client;
+
 	client = clnt_create(hostname, program, MOUNTVERS, "tcp");
 	if (client)
 		return client;
-- 
1.6.6


             reply	other threads:[~2010-01-05  1:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-05  1:34 Dan McGee [this message]
2010-01-05 17:31 ` [PATCH] showmount: try v3 before falling back to v1 Chuck Lever
2010-01-05 18:38   ` Steve Dickson
     [not found]     ` <4B438712.1080101-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2010-01-05 19:23       ` Chuck Lever
2010-01-05 20:38         ` Steve Dickson
     [not found]           ` <4B43A328.5000702-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2010-01-05 21:36             ` Dan McGee
2010-01-05 20:41 ` Steve Dickson
     [not found]   ` <4B43A3EF.4080401-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2010-01-05 22:31     ` Chuck Lever
2010-01-05 23:24       ` Steve Dickson
     [not found]         ` <4B43CA10.8080907-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2010-01-06 13:37           ` Chuck Lever
2010-01-07 16:37 ` Steve Dickson

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=1262655247-16849-1-git-send-email-dpmcgee@gmail.com \
    --to=dpmcgee@gmail.com \
    --cc=linux-nfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.