linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] retry for NFS v3 mounts
@ 2011-12-01 17:33 Dick Streefland, rnews
  2011-12-01 20:41 ` Steve Dickson
  0 siblings, 1 reply; 4+ messages in thread
From: Dick Streefland, rnews @ 2011-12-01 17:33 UTC (permalink / raw)
  To: linux-nfs

Mounting an NFS v3 volume from a server that is currently down,
immediately fails with a timeout error, instead of retrying:

# mount -t nfs -v -overs=3,proto=udp,bg server:/foo /mnt
mount.nfs: trying text-based options 'vers=3,proto=udp,bg,addr=172.17.2.94'
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Timed out

mount.nfs: mount to NFS server 'server:/foo' failed: timed out, giving up

# mount -t nfs -v -overs=3,proto=tcp,bg server:/foo /mnt
mount.nfs: trying text-based options 'vers=3,proto=tcp,bg,addr=172.17.2.94'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query failed: RPC: Remote system error - No route to host

mount.nfs: No route to host

As a result, NFS mounts may not come up after a power failure when the
client boots faster than the server. The attached patch for nfs-utils
adds ESPIPE to the list of errors considered temporary, so that the
mount will be retried:

# mount -t nfs -v -overs=3,proto=udp,bg server:/foo /mnt
mount.nfs: trying text-based options 'vers=3,proto=udp,bg,addr=172.17.2.94'
mount.nfs: prog 100003, trying vers=3, prot=17
mount.nfs: portmap query failed: RPC: Timed out

mount.nfs: backgrounding "server:/foo"
mount.nfs: mount options: "vers=3,proto=udp,bg,addr=172.17.2.94"

# mount -t nfs -v -overs=3,proto=tcp,bg server:/foo /mnt
mount.nfs: trying text-based options 'vers=3,proto=tcp,bg,addr=172.17.2.94'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: portmap query failed: RPC: Remote system error - No route to host

mount.nfs: backgrounding "server:/foo"
mount.nfs: mount options: "vers=3,proto=tcp,bg,addr=172.17.2.94"

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 4032bf3..7ca0b3e 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -663,6 +663,7 @@ static int nfs_try_mount_v3v2(struct nfsmount_info *mi)
 		case ECONNREFUSED:
 		case EOPNOTSUPP:
 		case EHOSTUNREACH:
+		case ESPIPE:
 			continue;
 		default:
 			goto out;
@@ -848,6 +849,7 @@ static int nfs_is_permanent_error(int error)
 	case ETIMEDOUT:
 	case ECONNREFUSED:
 	case EHOSTUNREACH:
+	case ESPIPE:
 		return 0;	/* temporary */
 	default:
 		return 1;	/* permanent */

-- 
Dick


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

end of thread, other threads:[~2011-12-05 14:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-01 17:33 [PATCH] retry for NFS v3 mounts Dick Streefland, rnews
2011-12-01 20:41 ` Steve Dickson
2011-12-02  9:47   ` Dick Streefland, rnews
2011-12-05 14:50   ` 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).