Skip to content

Commit

Permalink
[GFS2] Add NULL entry to token table
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
  • Loading branch information
Benjamin Marzinski authored and Steven Whitehouse committed Oct 10, 2007
1 parent 382e6e2 commit 9a5ad13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/gfs2/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ enum {
Opt_nosuiddir,
Opt_data_writeback,
Opt_data_ordered,
Opt_err,
};

static match_table_t tokens = {
Expand All @@ -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}
};

/**
Expand Down Expand Up @@ -237,6 +239,7 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, char *data_arg, int remount)
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;
Expand Down

0 comments on commit 9a5ad13

Please sign in to comment.