bz253289 Add NULL entry to token table
PATCH 1/1 bz253289 Add NULL entry to token table
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.
-------------- next part --------------
fs/gfs2/mount.c +4 -1
@@ -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 *sdpcase Opt_data_ordered: args->ar_data =GFS2_DATA_ORDERED ;break ; +case Opt_err:default :fs_info (sdp,"unknown option: %s\n" , o); error = -EINVAL ;
PATCH 1/1 bz253289 Add NULL entry to token table
Hi,
Now in the -nmw git tree. Thanks,
Steve.
Quoted 37 lines · Benjamin Marzinski
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) Formatch_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 <[email protected]>plain text document attachment (mount_panic.patch)
diff -urpN --exclude-from=gfs2-2.6-nmw/Documentation/dontdiffgfs2-2.6-nmw/fs/gfs2/mount.cgfs2-2.6-nmw-patched/fs/gfs2/mount.cfs/gfs2/mount.c +4
-1@@ -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 *sdpcase Opt_data_ordered: args->ar_data =GFS2_DATA_ORDERED ;break ; +case Opt_err:default :fs_info (sdp,"unknown option: %s\n" , o); error = -EINVAL ;