* [Cluster-devel] [PATCH] [GFS2] bz253289 Add NULL entry to token table
@ 2007-08-18 1:22 Benjamin Marzinski
2007-08-18 15:00 ` Steven Whitehouse
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Marzinski @ 2007-08-18 1:22 UTC (permalink / raw)
To: cluster-devel.redhat.com
match_token() was returning garbage data instead of a fail value. This data
happened to match a valid option id for an option that required an argument (in
this case, lockproto=%s) For match_token() to correctly fail if the option
doesn't match any of the tokens, the token table must end with a NULL entry.
This patch adds the NULL entry.
Signed-off-by: Benjamin E. Marzinski <bmarzins@redhat.com>
-------------- next part --------------
diff -urpN --exclude-from=gfs2-2.6-nmw/Documentation/dontdiff gfs2-2.6-nmw/fs/gfs2/mount.c gfs2-2.6-nmw-patched/fs/gfs2/mount.c
--- gfs2-2.6-nmw/fs/gfs2/mount.c 2007-08-13 16:18:01.000000000 -0500
+++ gfs2-2.6-nmw-patched/fs/gfs2/mount.c 2007-08-17 12:04:36.000000000 -0500
@@ -42,6 +42,7 @@ enum {
Opt_nosuiddir,
Opt_data_writeback,
Opt_data_ordered,
+ Opt_err,
};
static match_table_t tokens = {
@@ -64,7 +65,8 @@ static match_table_t tokens = {
{Opt_suiddir, "suiddir"},
{Opt_nosuiddir, "nosuiddir"},
{Opt_data_writeback, "data=writeback"},
- {Opt_data_ordered, "data=ordered"}
+ {Opt_data_ordered, "data=ordered"},
+ {Opt_err, NULL}
};
/**
@@ -237,6 +239,7 @@ int gfs2_mount_args(struct gfs2_sbd *sdp
case Opt_data_ordered:
args->ar_data = GFS2_DATA_ORDERED;
break;
+ case Opt_err:
default:
fs_info(sdp, "unknown option: %s\n", o);
error = -EINVAL;
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Cluster-devel] [PATCH] [GFS2] bz253289 Add NULL entry to token table
2007-08-18 1:22 [Cluster-devel] [PATCH] [GFS2] bz253289 Add NULL entry to token table Benjamin Marzinski
@ 2007-08-18 15:00 ` Steven Whitehouse
0 siblings, 0 replies; 2+ messages in thread
From: Steven Whitehouse @ 2007-08-18 15:00 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
Now in the -nmw git tree. Thanks,
Steve.
On Fri, 2007-08-17 at 20:22 -0500, Benjamin Marzinski wrote:
> match_token() was returning garbage data instead of a fail value. This data
> happened to match a valid option id for an option that required an argument (in
> this case, lockproto=%s) For match_token() to correctly fail if the option
> doesn't match any of the tokens, the token table must end with a NULL entry.
> This patch adds the NULL entry.
>
> Signed-off-by: Benjamin E. Marzinski <bmarzins@redhat.com>
> plain text document attachment (mount_panic.patch)
> diff -urpN --exclude-from=gfs2-2.6-nmw/Documentation/dontdiff gfs2-2.6-nmw/fs/gfs2/mount.c gfs2-2.6-nmw-patched/fs/gfs2/mount.c
> --- gfs2-2.6-nmw/fs/gfs2/mount.c 2007-08-13 16:18:01.000000000 -0500
> +++ gfs2-2.6-nmw-patched/fs/gfs2/mount.c 2007-08-17 12:04:36.000000000 -0500
> @@ -42,6 +42,7 @@ enum {
> Opt_nosuiddir,
> Opt_data_writeback,
> Opt_data_ordered,
> + Opt_err,
> };
>
> static match_table_t tokens = {
> @@ -64,7 +65,8 @@ static match_table_t tokens = {
> {Opt_suiddir, "suiddir"},
> {Opt_nosuiddir, "nosuiddir"},
> {Opt_data_writeback, "data=writeback"},
> - {Opt_data_ordered, "data=ordered"}
> + {Opt_data_ordered, "data=ordered"},
> + {Opt_err, NULL}
> };
>
> /**
> @@ -237,6 +239,7 @@ int gfs2_mount_args(struct gfs2_sbd *sdp
> case Opt_data_ordered:
> args->ar_data = GFS2_DATA_ORDERED;
> break;
> + case Opt_err:
> default:
> fs_info(sdp, "unknown option: %s\n", o);
> error = -EINVAL;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-18 15:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-18 1:22 [Cluster-devel] [PATCH] [GFS2] bz253289 Add NULL entry to token table Benjamin Marzinski
2007-08-18 15:00 ` Steven Whitehouse
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).