From patchwork Mon Jul 6 14:42:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Dickson X-Patchwork-Id: 6725241 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 184B5C05AC for ; Mon, 6 Jul 2015 14:42:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BF35205E2 for ; Mon, 6 Jul 2015 14:42:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60CB5205E1 for ; Mon, 6 Jul 2015 14:42:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752843AbbGFOmc (ORCPT ); Mon, 6 Jul 2015 10:42:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52903 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751412AbbGFOmb (ORCPT ); Mon, 6 Jul 2015 10:42:31 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 0B87A85538 for ; Mon, 6 Jul 2015 14:42:31 +0000 (UTC) Received: from smallhat.boston.devel.redhat.com (vpn-62-169.rdu2.redhat.com [10.10.62.169]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t66EgUBZ020235 for ; Mon, 6 Jul 2015 10:42:30 -0400 From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH] mount.nfs: Teach mount.nfs about the mountversion option Date: Mon, 6 Jul 2015 10:42:28 -0400 Message-Id: <1436193748-4301-1-git-send-email-steved@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When the mountversion option is used, there should not be any mount negotiations with the server. Also, when the option is used, its know that the mount is a v4 mount and a V_SPECFIC type. Signed-off-by: Steve Dickson --- utils/mount/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/utils/mount/network.c b/utils/mount/network.c index b5ed850..ebc39d3 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = { "v4", "vers", "nfsvers", + "minorversion", NULL, }; @@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version) if (!(version->major = strtol(version_val, &cptr, 10))) goto ret_error; - if (version->major < 4) + if (strcmp(nfs_version_opttbl[i], "minorversion") == 0) { + version->v_mode = V_SPECIFIC; + version->minor = version->major; + version->major = 4; + } else if (version->major < 4) version->v_mode = V_SPECIFIC; if (*cptr == '.') {