From: "J. Bruce Fields" <bfields@fieldses.org>
To: NeilBrown <neilb@suse.com>
Cc: Steve Dickson <SteveD@redhat.com>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
Martin Pitt <martin.pitt@ubuntu.com>
Subject: Re: [PATCH 2/2] mount: RPC_PROGNOTREGISTERED should not be a permanent error
Date: Fri, 19 Aug 2016 16:59:53 -0400 [thread overview]
Message-ID: <20160819205953.GO32329@fieldses.org> (raw)
In-Reply-To: <147157115640.26568.2934329194247787636.stgit@noble>
Just one more thought about this one....
If you mistakenly attempt to mount a server that's using rpc for some
service other than nfs, then this will result in a hang where we
previously got a useful error, right?
Maybe that's a rare enough case not to worry about these days.
--b.
On Fri, Aug 19, 2016 at 11:45:56AM +1000, NeilBrown wrote:
> Commit: bf66c9facb8e ("mounts.nfs: v2 and v3 background mounts should retry when server is down.")
>
> changed the behaviour of "bg" mounts so that RPC_PROGNOTREGISTERED,
> which maps to EOPNOTSUPP, is not a permanent error.
> This useful because when an NFS server starts up there is a small window between
> the moment that rpcbind (or portmap) starts responding to lookup requests,
> and the moment when nfsd registers with rpcbind. During that window
> rpcbind will reply with RPC_PROGNOTREGISTERED, but mount should not give up.
>
> This same reasoning applies to foreground mounts. They don't wait for
> as long, but could still hit the window and fail prematurely.
>
> So revert the above patch and instead add EOPNOTSUPP to the list of
> temporary errors known to nfs_is_permanent_error.
>
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
> utils/mount/stropts.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index 9de6794c6177..d5dfb5e4a669 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -948,6 +948,7 @@ static int nfs_is_permanent_error(int error)
> case ETIMEDOUT:
> case ECONNREFUSED:
> case EHOSTUNREACH:
> + case EOPNOTSUPP: /* aka RPC_PROGNOTREGISTERED */
> case EAGAIN:
> return 0; /* temporary */
> default:
> @@ -1019,8 +1020,7 @@ static int nfsmount_parent(struct nfsmount_info *mi)
> if (nfs_try_mount(mi))
> return EX_SUCCESS;
>
> - /* retry background mounts when the server is not up */
> - if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP) {
> + if (nfs_is_permanent_error(errno)) {
> mount_error(mi->spec, mi->node, errno);
> return EX_FAIL;
> }
> @@ -1055,8 +1055,7 @@ static int nfsmount_child(struct nfsmount_info *mi)
> if (nfs_try_mount(mi))
> return EX_SUCCESS;
>
> - /* retry background mounts when the server is not up */
> - if (nfs_is_permanent_error(errno) && errno != EOPNOTSUPP)
> + if (nfs_is_permanent_error(errno))
> break;
>
> if (time(NULL) > timeout)
>
next prev parent reply other threads:[~2016-08-19 21:08 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 1:45 [PATCH 0/2] nfs-utils patches relating to server startup NeilBrown
2016-08-19 1:45 ` [PATCH 1/2] systemd: improve ordering between nfs-server and various mounts NeilBrown
2016-08-19 17:38 ` J. Bruce Fields
2016-08-19 20:43 ` NeilBrown
2016-08-19 21:02 ` J. Bruce Fields
2016-08-20 13:51 ` Steve Dickson
2016-08-20 15:53 ` Steve Dickson
2016-08-20 17:09 ` Steve Dickson
2016-08-19 1:45 ` [PATCH 2/2] mount: RPC_PROGNOTREGISTERED should not be a permanent error NeilBrown
2016-08-19 20:59 ` J. Bruce Fields [this message]
2016-08-19 21:37 ` NeilBrown
2016-08-20 1:25 ` J. Bruce Fields
2016-11-22 17:33 ` Steve Dickson
[not found] ` <2a0955df-2fcd-05f1-9e6f-d8a549321177@RedHat.com>
2016-11-22 22:43 ` NeilBrown
2016-11-23 18:21 ` Steve Dickson
2016-11-23 23:26 ` NeilBrown
2016-11-28 17:24 ` Steve Dickson
2016-11-29 21:36 ` NeilBrown
2016-11-29 23:05 ` Steve Dickson
2016-11-30 1:33 ` NeilBrown
2016-08-19 20:37 ` [PATCH 0.5/2] Move export_d_read() to support/export/export.c NeilBrown
2016-08-19 21:01 ` [PATCH 0/2] nfs-utils patches relating to server startup J. Bruce Fields
2016-08-22 12:54 ` 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=20160819205953.GO32329@fieldses.org \
--to=bfields@fieldses.org \
--cc=SteveD@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=martin.pitt@ubuntu.com \
--cc=neilb@suse.com \
/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.