All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH - nfs-utils] Fix fallback from tcp to udp
@ 2014-02-17 23:43 NeilBrown
  2014-02-20 17:50 ` Steve Dickson
  0 siblings, 1 reply; 7+ messages in thread
From: NeilBrown @ 2014-02-17 23:43 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Chuck Lever, NFS, Carsten Ziepke

[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]


Protocol negotiation in mount.nfs does not correctly negotiate with a
server which only support NFSv3 and UDP.

When mount.nfs attempts an NFSv4 mount and fails with ECONNREFUSED
it does not fall back to NFSv3, as this is not recognised as a
"does not support NFSv4" error.
However ECONNREFUSED is a clear indication that the server doesn't
support TCP, and ipso facto does not support NFSv4.
So ECONNREFUSED should trigger a fallback from v4 to v2/3.

Once we allow that error, NFSv3 is attempted and mount.nfs talks to
rpcbind and discovers that UDP should be used for v3 and the mount
succeeds.

Signed-off-by: NeilBrown <neilb@suse.de>
Reported-by: Carsten Ziepke <kieltux@gmail.com>

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index a642394d2f5a..6d4fd70b7b9e 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -807,6 +807,9 @@ static int nfs_autonegotiate(struct nfsmount_info *mi)
 		/* Linux servers prior to 2.6.25 may return
 		 * EPERM when NFS version 4 is not supported. */
 		goto fall_back;
+	case ECONNREFUSED:
+		/* UDP-Only servers won't support v4 */
+		goto fall_back;
 	default:
 		return result;
 	}

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

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

end of thread, other threads:[~2014-02-21 15:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-17 23:43 [PATCH - nfs-utils] Fix fallback from tcp to udp NeilBrown
2014-02-20 17:50 ` Steve Dickson
2014-02-20 20:37   ` J. Bruce Fields
2014-02-20 20:42     ` J. Bruce Fields
2014-02-21  3:26     ` NeilBrown
2014-02-21 14:59       ` J. Bruce Fields
2014-02-21 15:22         ` Chuck Lever

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.