From patchwork Mon Jun 19 15:10:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 9796165 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 0C15660381 for ; Mon, 19 Jun 2017 15:11:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0EFB26E51 for ; Mon, 19 Jun 2017 15:11:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2D3026E69; Mon, 19 Jun 2017 15:11:09 +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=-6.9 required=2.0 tests=BAYES_00,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 72DA026E4A for ; Mon, 19 Jun 2017 15:11:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751768AbdFSPLI (ORCPT ); Mon, 19 Jun 2017 11:11:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28744 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751761AbdFSPLH (ORCPT ); Mon, 19 Jun 2017 11:11:07 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3B65BB14C for ; Mon, 19 Jun 2017 15:11:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3B65BB14C Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=steved@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3B65BB14C Received: from steved.boston.devel.redhat.com (ovpn-116-126.phx2.redhat.com [10.3.116.126]) by smtp.corp.redhat.com (Postfix) with ESMTP id E49428209D for ; Mon, 19 Jun 2017 15:11:01 +0000 (UTC) From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH 1/2 V3] mount.nfs: Use default minor version when -t nfs4 is specified Date: Mon, 19 Jun 2017 11:10:59 -0400 Message-Id: <20170619151100.25774-1-steved@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 19 Jun 2017 15:11:02 +0000 (UTC) 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 When the nfs4 filesystem specified, the default major and minor versions should be used. Signed-off-by: Steve Dickson --- utils/mount/stropts.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) v2: Added the NFS_DEFAULT_MAJOR/MINOR defines v3: Add back the setting of v_mode to V_GENERAL in nfs_set_version() diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index c0266e5..fbea6fb 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -73,6 +73,13 @@ #define NFS_DEF_BG_TIMEOUT_MINUTES (10000u) #endif +#ifndef NFS_DEFAULT_MAJOR +#define NFS_DEFAULT_MAJOR 4 +#endif +#ifndef NFS_DEFAULT_MINOR +#define NFS_DEFAULT_MINOR 2 +#endif + extern int nfs_mount_data_version; extern char *progname; extern int verbose; @@ -124,8 +131,8 @@ static void nfs_default_version(struct nfsmount_info *mi) } #endif /* MOUNT_CONFIG */ - mi->version.major = 4; - mi->version.minor = 2; + mi->version.major = NFS_DEFAULT_MAJOR; + mi->version.minor = NFS_DEFAULT_MINOR; } /* @@ -316,7 +323,9 @@ static int nfs_set_version(struct nfsmount_info *mi) return 0; if (strncmp(mi->type, "nfs4", 4) == 0) { - mi->version.major = 4; + /* Set to default values */ + mi->version.major = NFS_DEFAULT_MAJOR; + mi->version.minor = NFS_DEFAULT_MINOR; mi->version.v_mode = V_GENERAL; } /*