From patchwork Wed Dec 16 04:43:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 11976363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D725BC3526E for ; Wed, 16 Dec 2020 04:44:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC6432313F for ; Wed, 16 Dec 2020 04:44:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725890AbgLPEo0 (ORCPT ); Tue, 15 Dec 2020 23:44:26 -0500 Received: from mx2.suse.de ([195.135.220.15]:58562 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725889AbgLPEo0 (ORCPT ); Tue, 15 Dec 2020 23:44:26 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 2EC92AD5A; Wed, 16 Dec 2020 04:43:45 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Wed, 16 Dec 2020 15:43:03 +1100 Subject: [PATCH 3/7] Revert "mount.nfs: merge in vers= and nfsvers= options" Cc: Justin Mitchell , Benjamin Coddington , linux-nfs@vger.kernel.org Message-ID: <160809378307.7232.12486406696809312958.stgit@noble> In-Reply-To: <160809318571.7232.10427700322834760606.stgit@noble> References: <160809318571.7232.10427700322834760606.stgit@noble> User-Agent: StGit/0.23 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org This reverts commit 8110103404b35d9e86057ef0764f8aa87585f455. Using mnt_alias_tab[] to handle options which are synonyms isn't really a good fit. This sort-of works, but in part only because 'strstr()' is used for matching so "vers=" is found when "nfsvers=" is present. This doesn't handle other version-setting options like v2, v3, v4.x. So remove this commit to make room for a better solution. Signed-off-by: NeilBrown --- utils/mount/configfile.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c index 2470bc6a8bf6..e20aa73739fc 100644 --- a/utils/mount/configfile.c +++ b/utils/mount/configfile.c @@ -70,7 +70,6 @@ struct mnt_alias { {"background", "bg", MNT_NOARG}, {"foreground", "fg", MNT_NOARG}, {"sloppy", "sloppy", MNT_NOARG}, - {"nfsvers", "vers", MNT_UNSET}, }; int mnt_alias_sz = (sizeof(mnt_alias_tab)/sizeof(mnt_alias_tab[0])); @@ -296,21 +295,20 @@ conf_parse_mntopts(char *section, char *arg, char *opts) list = conf_get_tag_list(section, arg); TAILQ_FOREACH(node, &list->fields, link) { - /* check first if this is an alias for another option */ - field = mountopts_alias(node->field, &argtype); /* * Do not overwrite options if already exists */ - snprintf(buf, BUFSIZ, "%s=", field); + snprintf(buf, BUFSIZ, "%s=", node->field); if (opts && strcasestr(opts, buf) != NULL) continue; - if (lookup_entry(field) != NULL) + if (lookup_entry(node->field) != NULL) continue; buf[0] = '\0'; value = conf_get_section(section, arg, node->field); if (value == NULL) continue; + field = mountopts_alias(node->field, &argtype); if (strcasecmp(value, "false") == 0) { if (argtype != MNT_NOARG) snprintf(buf, BUFSIZ, "no%s", field);