All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Coddington <bcodding@redhat.com>
To: linux-nfs@vger.kernel.org
Subject: [PATCH 5/6] nfsmount.conf: Always parse versions
Date: Tue, 18 Nov 2014 09:06:43 -0500	[thread overview]
Message-ID: <faafa3196744558c93158242a7363dcd0a467351.1416319371.git.bcodding@redhat.com> (raw)
In-Reply-To: <cover.1416319371.git.bcodding@redhat.com>
In-Reply-To: <cover.1416319371.git.bcodding@redhat.com>

In order to make decisions about which default version to use when only the
major version is specified, the nfsmount.conf Defaultvers options should
always be parsed, even when a version has already been specified.  Remove
the check and bypass for parsing the Defaultvers options from nfsmount.conf.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
---
 utils/mount/configfile.c |   34 ----------------------------------
 1 files changed, 0 insertions(+), 34 deletions(-)

diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c
index a0072f1..0a4cc04 100644
--- a/utils/mount/configfile.c
+++ b/utils/mount/configfile.c
@@ -228,35 +228,6 @@ void free_all(void)
 		free(entry);
 	}
 }
-static char *versions[] = {"v2", "v3", "v4", "vers", "nfsvers", NULL};
-static int 
-check_vers(char *mopt, char *field)
-{
-	int i, found=0;
-
-	/*
-	 * First check to see if the config setting is one 
-	 * of the many version settings
-	 */
-	for (i=0; versions[i]; i++) { 
-		if (strcasestr(field, versions[i]) != NULL) {
-			found++;
-			break;
-		}
-	}
-	if (!found)
-		return 0;
-	/*
-	 * It appears the version is being set, now see
-	 * if the version appears on the command 
-	 */
-	for (i=0; versions[i]; i++)  {
-		if (strcasestr(mopt, versions[i]) != NULL)
-			return 1;
-	}
-
-	return 0;
-}
 
 struct nfs_version config_default_vers;
 unsigned long config_default_proto;
@@ -331,11 +302,6 @@ conf_parse_mntopts(char *section, char *arg, char *opts)
 		snprintf(buf, BUFSIZ, "%s=", node->field);
 		if (opts && strcasestr(opts, buf) != NULL)
 			continue;
-		/* 
-		 * Protocol verions can be set in a number of ways
-		 */
-		if (opts && check_vers(opts, node->field))
-			continue;
 
 		if (lookup_entry(node->field) != NULL)
 			continue;
-- 
1.7.1


  parent reply	other threads:[~2014-11-18 14:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-18 14:06 [PATCH v2 0/6] mount.nfs default version Benjamin Coddington
2014-11-18 14:06 ` [PATCH 1/6] mount.nfs: default enable mount config file (nfsmount.conf) Benjamin Coddington
2014-11-18 14:06 ` [PATCH 2/6] mount.nfs: fix a comment typo in parse options Benjamin Coddington
2014-11-18 14:06 ` [PATCH 3/6] mount.nfs: parse options - add helper po_contains_prefix Benjamin Coddington
2014-11-18 14:06 ` [PATCH 4/6] mount.nfs: Add struct nfs_version and generalize version parsing Benjamin Coddington
2014-11-18 14:06 ` Benjamin Coddington [this message]
2014-11-18 14:06 ` [PATCH 6/6] mount.nfs: configurable minor version defaults Benjamin Coddington
2015-01-28 21:29 ` [PATCH v2 0/6] mount.nfs default version Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=faafa3196744558c93158242a7363dcd0a467351.1416319371.git.bcodding@redhat.com \
    --to=bcodding@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.