All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfs-utils: Backgrounding mount broken with NFS versions <4
Date: Mon, 15 Oct 2012 16:10:03 -0400	[thread overview]
Message-ID: <507C6D9B.9070009@RedHat.com> (raw)
In-Reply-To: <20121012120030.18411.qmail@md.dent.med.uni-muenchen.de>



On 12/10/12 08:00, Wolfram Gloger wrote:
> When the NFS version isn't specified in the mount options, mount.nfs
> attempts V4 first and appends 'vers=4' to the extra_options string in
> the mount options.  If the server isn't immediately reachable, this
> attempt fails.  However, if the background option is specified and the
> server comes up later on, the extra_options are used again for all
> further attempts and thus they fail if the server only supports
> vers<4.
> 
> Fix this by only amending extra_options on a successful vers=4 mount.
> 
> This is now Debian bug #690181 and has apparently been around for
> ages.
> 
> Signed-off-by: Wolfram Gloger <bugzilla1@malloc.de>
Committed....

steved.
> 
> --- utils/mount/stropts.c.orig	2012-08-23 19:41:56.000000000 +0200
> +++ utils/mount/stropts.c	2012-10-11 13:46:25.000000000 +0200
> @@ -680,6 +680,7 @@
>  {
>  	struct mount_options *options = po_dup(mi->options);
>  	int result = 0;
> +	char *extra_opts = NULL;
>  
>  	if (!options) {
>  		errno = ENOMEM;
> @@ -715,20 +716,26 @@
>  		goto out_fail;
>  	}
>  
> -	/*
> -	 * Update option string to be recorded in /etc/mtab.
> -	 */
> -	if (po_join(options, mi->extra_opts) == PO_FAILED) {
> +	if (po_join(options, &extra_opts) == PO_FAILED) {
>  		errno = ENOMEM;
>  		goto out_fail;
>  	}
>  
>  	if (verbose)
>  		printf(_("%s: trying text-based options '%s'\n"),
> -			progname, *mi->extra_opts);
> +			progname, extra_opts);
>  
>  	result = nfs_sys_mount(mi, options);
>  
> +	/*
> +	 * If success, update option string to be recorded in /etc/mtab.
> +	 */
> +	if (result) {
> +	    free(*mi->extra_opts);
> +	    *mi->extra_opts = extra_opts;
> +	} else
> +	    free(extra_opts);
> +
>  out_fail:
>  	po_destroy(options);
>  	return result;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

      parent reply	other threads:[~2012-10-15 20:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12 12:00 [PATCH] nfs-utils: Backgrounding mount broken with NFS versions <4 Wolfram Gloger
2012-10-13 16:23 ` Chuck Lever
2012-10-13 17:18   ` Wolfram Gloger
2012-10-13 17:25     ` Chuck Lever
2012-10-13 21:46       ` Wolfram Gloger
2012-10-14 19:10         ` Chuck Lever
2012-10-14 20:09           ` Wolfram Gloger
2012-10-15 20:10 ` 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=507C6D9B.9070009@RedHat.com \
    --to=steved@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=wmglo@dent.med.uni-muenchen.de \
    /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.