* [PATCH 1/2] mountd: Fixed strcmp usage in in insert groups.
@ 2011-08-01 19:02 Matthew Treinish
2011-08-01 19:02 ` [PATCH 2/2] mountd: Removed duplicate check from insert_groups Matthew Treinish
2011-08-03 17:45 ` [PATCH 1/2] mountd: Fixed strcmp usage in in insert groups Steve Dickson
0 siblings, 2 replies; 4+ messages in thread
From: Matthew Treinish @ 2011-08-01 19:02 UTC (permalink / raw)
To: linux-nfs; +Cc: Matthew Treinish
Fixed the usage of strcmp in the duplicate check in insert groups. Fixes an
issue with showmount and other commands that required the group information.
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
---
utils/mountd/mountd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
index 035624c..bcf5080 100644
--- a/utils/mountd/mountd.c
+++ b/utils/mountd/mountd.c
@@ -633,7 +633,7 @@ static void insert_group(struct exportnode *e, char *newname)
struct groupnode *g;
for (g = e->ex_groups; g; g = g->gr_next)
- if (strcmp(g->gr_name, newname))
+ if (!strcmp(g->gr_name, newname))
return;
g = xmalloc(sizeof(*g));
--
1.7.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] mountd: Removed duplicate check from insert_groups
2011-08-01 19:02 [PATCH 1/2] mountd: Fixed strcmp usage in in insert groups Matthew Treinish
@ 2011-08-01 19:02 ` Matthew Treinish
2011-08-03 17:46 ` Steve Dickson
2011-08-03 17:45 ` [PATCH 1/2] mountd: Fixed strcmp usage in in insert groups Steve Dickson
1 sibling, 1 reply; 4+ messages in thread
From: Matthew Treinish @ 2011-08-01 19:02 UTC (permalink / raw)
To: linux-nfs; +Cc: Matthew Treinish
Upon further inspection of mountd the duplicate check in insert group is not
needed. It seems that export_read() already filters out duplicates so the
check for duplicates again in insert groups isn't needed.
Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
---
utils/mountd/mountd.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
index bcf5080..9c27d6c 100644
--- a/utils/mountd/mountd.c
+++ b/utils/mountd/mountd.c
@@ -631,11 +631,6 @@ static exportnode *lookup_or_create_elist_entry(exports *elist, nfs_export *exp)
static void insert_group(struct exportnode *e, char *newname)
{
struct groupnode *g;
-
- for (g = e->ex_groups; g; g = g->gr_next)
- if (!strcmp(g->gr_name, newname))
- return;
-
g = xmalloc(sizeof(*g));
g->gr_name = xstrdup(newname);
g->gr_next = e->ex_groups;
--
1.7.4.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] mountd: Fixed strcmp usage in in insert groups.
2011-08-01 19:02 [PATCH 1/2] mountd: Fixed strcmp usage in in insert groups Matthew Treinish
2011-08-01 19:02 ` [PATCH 2/2] mountd: Removed duplicate check from insert_groups Matthew Treinish
@ 2011-08-03 17:45 ` Steve Dickson
1 sibling, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2011-08-03 17:45 UTC (permalink / raw)
To: Matthew Treinish; +Cc: linux-nfs
On 08/01/2011 03:02 PM, Matthew Treinish wrote:
> Fixed the usage of strcmp in the duplicate check in insert groups. Fixes an
> issue with showmount and other commands that required the group information.
>
> Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
Committed...
steved.
> ---
> utils/mountd/mountd.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
> index 035624c..bcf5080 100644
> --- a/utils/mountd/mountd.c
> +++ b/utils/mountd/mountd.c
> @@ -633,7 +633,7 @@ static void insert_group(struct exportnode *e, char *newname)
> struct groupnode *g;
>
> for (g = e->ex_groups; g; g = g->gr_next)
> - if (strcmp(g->gr_name, newname))
> + if (!strcmp(g->gr_name, newname))
> return;
>
> g = xmalloc(sizeof(*g));
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] mountd: Removed duplicate check from insert_groups
2011-08-01 19:02 ` [PATCH 2/2] mountd: Removed duplicate check from insert_groups Matthew Treinish
@ 2011-08-03 17:46 ` Steve Dickson
0 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2011-08-03 17:46 UTC (permalink / raw)
To: Matthew Treinish; +Cc: linux-nfs
On 08/01/2011 03:02 PM, Matthew Treinish wrote:
> Upon further inspection of mountd the duplicate check in insert group is not
> needed. It seems that export_read() already filters out duplicates so the
> check for duplicates again in insert groups isn't needed.
I think this check is still needed so for now I'm going to
leave it...
steved.
>
> Signed-off-by: Matthew Treinish <treinish@linux.vnet.ibm.com>
> ---
> utils/mountd/mountd.c | 5 -----
> 1 files changed, 0 insertions(+), 5 deletions(-)
>
> diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c
> index bcf5080..9c27d6c 100644
> --- a/utils/mountd/mountd.c
> +++ b/utils/mountd/mountd.c
> @@ -631,11 +631,6 @@ static exportnode *lookup_or_create_elist_entry(exports *elist, nfs_export *exp)
> static void insert_group(struct exportnode *e, char *newname)
> {
> struct groupnode *g;
> -
> - for (g = e->ex_groups; g; g = g->gr_next)
> - if (!strcmp(g->gr_name, newname))
> - return;
> -
> g = xmalloc(sizeof(*g));
> g->gr_name = xstrdup(newname);
> g->gr_next = e->ex_groups;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-08-03 17:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-01 19:02 [PATCH 1/2] mountd: Fixed strcmp usage in in insert groups Matthew Treinish
2011-08-01 19:02 ` [PATCH 2/2] mountd: Removed duplicate check from insert_groups Matthew Treinish
2011-08-03 17:46 ` Steve Dickson
2011-08-03 17:45 ` [PATCH 1/2] mountd: Fixed strcmp usage in in insert groups 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).