From patchwork Tue Apr 10 14:29:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 10333273 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6ED426053C for ; Tue, 10 Apr 2018 14:29:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DE0C200DF for ; Tue, 10 Apr 2018 14:29:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4FA1B201B1; Tue, 10 Apr 2018 14:29:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA2A6200DF for ; Tue, 10 Apr 2018 14:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753243AbeDJO3z (ORCPT ); Tue, 10 Apr 2018 10:29:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59470 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753120AbeDJO3z (ORCPT ); Tue, 10 Apr 2018 10:29:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F236D40201A3 for ; Tue, 10 Apr 2018 14:29:54 +0000 (UTC) Received: from steved.boston.devel.redhat.com (steved.boston.devel.redhat.com [10.19.60.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD31D11701C5 for ; Tue, 10 Apr 2018 14:29:54 +0000 (UTC) From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH] mount.nfs: Fix auto protocol negotiation Date: Tue, 10 Apr 2018 10:29:52 -0400 Message-Id: <20180410142952.10657-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Apr 2018 14:29:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 10 Apr 2018 14:29:55 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'steved@redhat.com' RCPT:'' Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 71b807e1 introduce a regression that caused v3 not to be tried when v4 was not supported by the server during auto negation. A check of the type in nfs_nfs_version() was reverted back to only check for the "nfs4" string not the "nfs" string which fixed the problem. Signed-off-by: Steve Dickson --- utils/mount/network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/mount/network.c b/utils/mount/network.c index 9a2c878..e490399 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -1279,8 +1279,8 @@ nfs_nfs_version(char *type, struct mount_options *options, struct nfs_version *v } } - if (!found && strncmp(type, "nfs", 3) == 0) - version_val = "4"; + if (!found && strcmp(type, "nfs4") == 0) + version_val = type + 3; else if (!found) return 1; else if (i <= 2 ) {