From: dick@streefland.net (Dick Streefland)
From: rnews@altium.nl
To: linux-nfs@vger.kernel.org
Subject: [PATCH] retry for NFS v3 mounts
Date: Thu, 01 Dec 2011 17:33:08 -0000 [thread overview]
Message-ID: <37c5.4ed7ba54.3cfb1@altium.nl> (raw)
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
next reply other threads:[~2011-12-01 17:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-01 17:33 Dick Streefland, rnews [this message]
2011-12-01 20:41 ` [PATCH] retry for NFS v3 mounts Steve Dickson
2011-12-02 9:47 ` Dick Streefland, rnews
2011-12-05 14:50 ` 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=37c5.4ed7ba54.3cfb1@altium.nl \
--to=dick@streefland.net \
--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.