Received: by 2002:a17:90a:2044:0:0:0:0 with SMTP id n62csp532581pjc; Mon, 20 May 2019 11:22:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0Wpu3QwAf/nRrSLxJHgXum3M2LMmqqEHOtx9252mmNZrAEYlE5fXWpnf/0b+rVS8DmENX X-Received: by 2002:a17:902:bb06:: with SMTP id l6mr19268573pls.78.1558376523619; Mon, 20 May 2019 11:22:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558376523; cv=none; d=google.com; s=arc-20160816; b=0UVVCk135QY4HxfEatX0y80MoixbvBjbYWEAyDDg8w5HvElNEmJj9vAMwOG7tjoZQu uS+yAOjOYbrehBZ4ak2K50nAskgXYaiEEhEuhdI/EDY6tz0Sro3woJy2mLl2Joai0/UY ktusO24v0FoXM9JQTvcgpGXNDmWZm4v/nIe64wIHfob2kC3m66RhgPiwKA1uMOzVzaY0 nomY23XP0hJwJKG778yVVLBzYA1QQRyJh0TbTDsBNRoCbPtPnlccO+R8486nD+6ogKbF wceB4/kNSImFs2TIlEoqbZyTzKDfnsxoagzJ9dFOz4ECBVaW3uUEpc4+4S+jmXq7VbsU z6SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=ZefFmHVIQT/oMU3y/vlDDIHfRbg7iVTqbggeSzPzinI=; b=VArnVMkx2YY6QWnf1d0f0MZm+nz3HGOShuFSzhOZwKnQvCJnNiY7SEEsLY8PDPyvPx dliE0yf74l5zoLeD2py5fN2ng4c9J+3DY03Rdg8qdf9s8YuOfg68Ej/NksHNv853Xyjd YyBLhm1//M98GUEVt3nCPaza5975DkvW10YsL+TrHUywD86oOGUbgDFKwLEwzvk2x3h4 cykYjtPNwFvFp/KyvGYnz00GdptySmsNK1luEUGPEZsqsw4PapBTJ9/QnMX1EEdLdj9K crFUjZwGgsKu0HSkq5owOklb6r1pHDAEWfIjA+h0cdm2iWkeVKpgs8sCOXdVXUnccDSs Q1Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w188si20145688pfd.204.2019.05.20.11.21.49; Mon, 20 May 2019 11:22:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390979AbfETRnH (ORCPT + 99 others); Mon, 20 May 2019 13:43:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57498 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390970AbfETRnH (ORCPT ); Mon, 20 May 2019 13:43:07 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 42FEA3082E69 for ; Mon, 20 May 2019 17:43:07 +0000 (UTC) Received: from madhat.boston.devel.redhat.com (ovpn-116-44.phx2.redhat.com [10.3.116.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0E15360BEC for ; Mon, 20 May 2019 17:43:06 +0000 (UTC) Subject: Re: [PATCH] mount: Report correct error in the fall_back cases. To: Linux NFS Mailing list References: <20190514200418.19902-1-steved@redhat.com> From: Steve Dickson Message-ID: <32b5b347-7c97-fbd9-6534-8a675163a945@RedHat.com> Date: Mon, 20 May 2019 13:43:06 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190514200418.19902-1-steved@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 20 May 2019 17:43:07 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 5/14/19 4:04 PM, Steve Dickson wrote: > In mount auto negotiation, a v3 mount is tried > when the v4 fails with error that could mean > v4 is not supported. > > When the v3 mount fails, the original v4 failure > should be used to set the errno, not the v3 failure. > > Fixes:https://bugzilla.redhat.com/show_bug.cgi?id=1709961 > Signed-off-by: Steve Dickson Committed.... steved, > --- > utils/mount/stropts.c | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > > diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c > index 1bb7a73..901f995 100644 > --- a/utils/mount/stropts.c > +++ b/utils/mount/stropts.c > @@ -889,7 +889,7 @@ out: > */ > static int nfs_autonegotiate(struct nfsmount_info *mi) > { > - int result; > + int result, olderrno; > > result = nfs_try_mount_v4(mi); > check_result: > @@ -949,7 +949,18 @@ fall_back: > if (mi->version.v_mode == V_GENERAL) > /* v2,3 fallback not allowed */ > return result; > - return nfs_try_mount_v3v2(mi, FALSE); > + > + /* > + * Save the original errno in case the v3 > + * mount fails from one of the fall_back cases. > + * Report the first failure not the v3 mount failure > + */ > + olderrno = errno; > + if ((result = nfs_try_mount_v3v2(mi, FALSE))) > + return result; > + > + errno = olderrno; > + return result; > } > > /* >