Linux NFS development
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@RedHat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] mount.nfs: Restore errno after v3 mounts on ECONNREFUSED errors
Date: Fri, 5 May 2017 11:07:35 -0400	[thread overview]
Message-ID: <afbc664f-b8a3-76b2-0744-2db94d195c06@RedHat.com> (raw)
In-Reply-To: <20170504143704.18263-1-steved@redhat.com>



On 05/04/2017 10:37 AM, Steve Dickson wrote:
> Commit 65ac59cd introduced code that tries v3 mounts
> when the the v4 mount fails with ECONNREFUSED. This
> code allows failing back to v3 to work correctly.
> 
> When the v3 mount fails the original errno value has
> been over rewritten. In this case the errno value
> needs to be restored to ECONNREFUSED.
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed...

steved.
> ---
>  utils/mount/stropts.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index a9ff95d..0fbb375 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -868,7 +868,10 @@ check_result:
>  			result = nfs_try_mount_v4(mi);
>  			if (result == 0 && errno != ECONNREFUSED)
>  				goto check_result;
> -		}
> +		} else if (result == 0)
> +			/* Restore original errno with v3 failures */
> +			errno = ECONNREFUSED;
> +
>  		return result;
>  	default:
>  		return result;
> 

      reply	other threads:[~2017-05-05 15:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04 14:37 [PATCH] mount.nfs: Restore errno after v3 mounts on ECONNREFUSED errors Steve Dickson
2017-05-05 15:07 ` 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=afbc664f-b8a3-76b2-0744-2db94d195c06@RedHat.com \
    --to=steved@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox