linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] showmount: try v3 before falling back to v1
@ 2010-01-05  1:34 Dan McGee
  2010-01-05 17:31 ` Chuck Lever
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Dan McGee @ 2010-01-05  1:34 UTC (permalink / raw)
  To: linux-nfs; +Cc: Dan McGee

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-01-07 17:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-05  1:34 [PATCH] showmount: try v3 before falling back to v1 Dan McGee
2010-01-05 17:31 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).