All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Benjamin Coddington <bcodding@redhat.com>
Cc: Chuck Lever <chuck.lever@oracle.com>, linux-nfs@vger.kernel.org
Subject: Re: [PATCH nfs-utils] mount.nfs: skip server address resolution on remount
Date: Thu, 28 Apr 2016 08:16:16 -0400	[thread overview]
Message-ID: <5721FF10.2050208@RedHat.com> (raw)
In-Reply-To: <83c9ef2c8e6c5ece11791e5c39609a1db9f716de.1459967426.git.bcodding@redhat.com>



On 04/06/2016 02:30 PM, Benjamin Coddington wrote:
> A remount might fail if name resolution returns a different server address,
> as might occur if there are multiple name records for the server.  Since we
> cannot change the server's address on a remount anyway, skip the lookup and
> remove any set addresses in the options.
> 
> Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Committed... 

steved.
> ---
>  utils/mount/stropts.c |   31 ++++++++++++++++++++-----------
>  1 files changed, 20 insertions(+), 11 deletions(-)
> 
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index 86829a9..634b58c 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -383,13 +383,26 @@ static int nfs_validate_options(struct nfsmount_info *mi)
>  	if (!nfs_nfs_proto_family(mi->options, &family))
>  		return 0;
>  
> -	hint.ai_family = (int)family;
> -	error = getaddrinfo(mi->hostname, NULL, &hint, &mi->address);
> -	if (error != 0) {
> -		nfs_error(_("%s: Failed to resolve server %s: %s"),
> -			progname, mi->hostname, gai_strerror(error));
> -		mi->address = NULL;
> -		return 0;
> +	/*
> +	 * A remount is not going to be able to change the server's address,
> +	 * nor should we try to resolve another address for the server as we
> +	 * may end up with a different address.
> +	 */
> +	if (mi->flags & MS_REMOUNT) {
> +		po_remove_all(mi->options, "addr");
> +	} else {
> +		hint.ai_family = (int)family;
> +		error = getaddrinfo(mi->hostname, NULL, &hint, &mi->address);
> +		if (error != 0) {
> +			nfs_error(_("%s: Failed to resolve server %s: %s"),
> +				progname, mi->hostname, gai_strerror(error));
> +			mi->address = NULL;
> +			return 0;
> +		}
> +
> +		if (!nfs_append_addr_option(mi->address->ai_addr,
> +						mi->address->ai_addrlen, mi->options))
> +			return 0;
>  	}
>  
>  	if (!nfs_set_version(mi))
> @@ -398,10 +411,6 @@ static int nfs_validate_options(struct nfsmount_info *mi)
>  	if (!nfs_append_sloppy_option(mi->options))
>  		return 0;
>  
> -	if (!nfs_append_addr_option(mi->address->ai_addr,
> -					mi->address->ai_addrlen, mi->options))
> -		return 0;
> -
>  	return 1;
>  }
>  
> 

      parent reply	other threads:[~2016-04-28 12:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06 18:30 [PATCH nfs-utils] mount.nfs: skip server address resolution on remount Benjamin Coddington
2016-04-06 18:51 ` Chuck Lever
2016-04-07  8:46   ` Benjamin Coddington
2016-04-28 12:16 ` Steve Dickson [this message]

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=5721FF10.2050208@RedHat.com \
    --to=steved@redhat.com \
    --cc=bcodding@redhat.com \
    --cc=chuck.lever@oracle.com \
    --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.