* [PATCH 1/2] nfsmount.conf: Remove duplicate 'bg' and 'fg' from parsing string.
@ 2013-10-08 21:30 Steve Dickson
2013-10-08 21:30 ` [PATCH 2/2] nfsmount.conf: remove duplicate 'timeo' from the " Steve Dickson
2013-10-21 14:04 ` [PATCH 1/2] nfsmount.conf: Remove duplicate 'bg' and 'fg' from " Steve Dickson
0 siblings, 2 replies; 4+ messages in thread
From: Steve Dickson @ 2013-10-08 21:30 UTC (permalink / raw)
To: Linux NFS Mailing list
When the 'Background' and/or 'Foreground' options are set
in multiple sections of the nfsmount.conf file, each instance
gets added to the parsing string. This patch makes the first
instance of either option override the any others.
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mount/configfile.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c
index 68b9f93..6985ed9 100644
--- a/utils/mount/configfile.c
+++ b/utils/mount/configfile.c
@@ -164,6 +164,20 @@ add_entry(char *opt)
SLIST_INSERT_HEAD(&head, entry, entries);
}
/*
+ * Check the alias list to see if the given
+ * opt is a alias
+ */
+char *is_alias(char *opt)
+{
+ int i;
+
+ for (i=0; i < mnt_alias_sz; i++) {
+ if (strcasecmp(opt, mnt_alias_tab[i].alias) == 0)
+ return mnt_alias_tab[i].opt;
+ }
+ return NULL;
+}
+/*
* See if the given entry exists if the link list,
* if so return that entry
*/
@@ -171,10 +185,21 @@ inline static
char *lookup_entry(char *opt)
{
struct entry *entry;
+ char *alias = is_alias(opt);
SLIST_FOREACH(entry, &head, entries) {
if (strcasecmp(entry->opt, opt) == 0)
return opt;
+ if (alias && strcasecmp(entry->opt, alias) == 0)
+ return opt;
+ if (alias && strcasecmp(alias, "fg") == 0) {
+ if (strcasecmp(entry->opt, "bg") == 0)
+ return opt;
+ }
+ if (alias && strcasecmp(alias, "bg") == 0) {
+ if (strcasecmp(entry->opt, "fg") == 0)
+ return opt;
+ }
}
return NULL;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] nfsmount.conf: remove duplicate 'timeo' from the parsing string
2013-10-08 21:30 [PATCH 1/2] nfsmount.conf: Remove duplicate 'bg' and 'fg' from parsing string Steve Dickson
@ 2013-10-08 21:30 ` Steve Dickson
2013-10-21 14:04 ` Steve Dickson
2013-10-21 14:04 ` [PATCH 1/2] nfsmount.conf: Remove duplicate 'bg' and 'fg' from " Steve Dickson
1 sibling, 1 reply; 4+ messages in thread
From: Steve Dickson @ 2013-10-08 21:30 UTC (permalink / raw)
To: Linux NFS Mailing list
When the 'timeo' option is specified in multiple sections of
the nfsmount.conf file, each instance is added to the parsing
string. This patch make the first instance override any others.
Signed-off-by: Steve Dickson <steved@redhat.com>
---
utils/mount/configfile.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c
index 6985ed9..39d3741 100644
--- a/utils/mount/configfile.c
+++ b/utils/mount/configfile.c
@@ -186,8 +186,18 @@ char *lookup_entry(char *opt)
{
struct entry *entry;
char *alias = is_alias(opt);
+ char *ptr;
SLIST_FOREACH(entry, &head, entries) {
+ /*
+ * Only check the left side or options that use '='
+ */
+ if ((ptr = strchr(entry->opt, '=')) != 0) {
+ int len = (int) (ptr - entry->opt);
+
+ if (strncasecmp(entry->opt, opt, len) == 0)
+ return opt;
+ }
if (strcasecmp(entry->opt, opt) == 0)
return opt;
if (alias && strcasecmp(entry->opt, alias) == 0)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 2/2] nfsmount.conf: remove duplicate 'timeo' from the parsing string
2013-10-08 21:30 ` [PATCH 2/2] nfsmount.conf: remove duplicate 'timeo' from the " Steve Dickson
@ 2013-10-21 14:04 ` Steve Dickson
0 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2013-10-21 14:04 UTC (permalink / raw)
To: Steve Dickson; +Cc: Linux NFS Mailing list
On 08/10/13 17:30, Steve Dickson wrote:
> When the 'timeo' option is specified in multiple sections of
> the nfsmount.conf file, each instance is added to the parsing
> string. This patch make the first instance override any others.
>
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed...
steved.
> ---
> utils/mount/configfile.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c
> index 6985ed9..39d3741 100644
> --- a/utils/mount/configfile.c
> +++ b/utils/mount/configfile.c
> @@ -186,8 +186,18 @@ char *lookup_entry(char *opt)
> {
> struct entry *entry;
> char *alias = is_alias(opt);
> + char *ptr;
>
> SLIST_FOREACH(entry, &head, entries) {
> + /*
> + * Only check the left side or options that use '='
> + */
> + if ((ptr = strchr(entry->opt, '=')) != 0) {
> + int len = (int) (ptr - entry->opt);
> +
> + if (strncasecmp(entry->opt, opt, len) == 0)
> + return opt;
> + }
> if (strcasecmp(entry->opt, opt) == 0)
> return opt;
> if (alias && strcasecmp(entry->opt, alias) == 0)
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] nfsmount.conf: Remove duplicate 'bg' and 'fg' from parsing string.
2013-10-08 21:30 [PATCH 1/2] nfsmount.conf: Remove duplicate 'bg' and 'fg' from parsing string Steve Dickson
2013-10-08 21:30 ` [PATCH 2/2] nfsmount.conf: remove duplicate 'timeo' from the " Steve Dickson
@ 2013-10-21 14:04 ` Steve Dickson
1 sibling, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2013-10-21 14:04 UTC (permalink / raw)
To: Steve Dickson; +Cc: Linux NFS Mailing list
On 08/10/13 17:30, Steve Dickson wrote:
> When the 'Background' and/or 'Foreground' options are set
> in multiple sections of the nfsmount.conf file, each instance
> gets added to the parsing string. This patch makes the first
> instance of either option override the any others.
>
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed...
steved.
> ---
> utils/mount/configfile.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/utils/mount/configfile.c b/utils/mount/configfile.c
> index 68b9f93..6985ed9 100644
> --- a/utils/mount/configfile.c
> +++ b/utils/mount/configfile.c
> @@ -164,6 +164,20 @@ add_entry(char *opt)
> SLIST_INSERT_HEAD(&head, entry, entries);
> }
> /*
> + * Check the alias list to see if the given
> + * opt is a alias
> + */
> +char *is_alias(char *opt)
> +{
> + int i;
> +
> + for (i=0; i < mnt_alias_sz; i++) {
> + if (strcasecmp(opt, mnt_alias_tab[i].alias) == 0)
> + return mnt_alias_tab[i].opt;
> + }
> + return NULL;
> +}
> +/*
> * See if the given entry exists if the link list,
> * if so return that entry
> */
> @@ -171,10 +185,21 @@ inline static
> char *lookup_entry(char *opt)
> {
> struct entry *entry;
> + char *alias = is_alias(opt);
>
> SLIST_FOREACH(entry, &head, entries) {
> if (strcasecmp(entry->opt, opt) == 0)
> return opt;
> + if (alias && strcasecmp(entry->opt, alias) == 0)
> + return opt;
> + if (alias && strcasecmp(alias, "fg") == 0) {
> + if (strcasecmp(entry->opt, "bg") == 0)
> + return opt;
> + }
> + if (alias && strcasecmp(alias, "bg") == 0) {
> + if (strcasecmp(entry->opt, "fg") == 0)
> + return opt;
> + }
> }
> return NULL;
> }
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-21 14:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-08 21:30 [PATCH 1/2] nfsmount.conf: Remove duplicate 'bg' and 'fg' from parsing string Steve Dickson
2013-10-08 21:30 ` [PATCH 2/2] nfsmount.conf: remove duplicate 'timeo' from the " Steve Dickson
2013-10-21 14:04 ` Steve Dickson
2013-10-21 14:04 ` [PATCH 1/2] nfsmount.conf: Remove duplicate 'bg' and 'fg' from " Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).