Skip to content

Commit

Permalink
ext4: fix crash when accessing /proc/mounts concurrently
Browse files Browse the repository at this point in the history
The crash was caused by a variable being erronously declared static in
token2str().

In addition to /proc/mounts, the problem can also be easily replicated
by accessing /proc/fs/ext4/<partition>/options in parallel:

$ cat /proc/fs/ext4/<partition>/options > options.txt

... and then running the following command in two different terminals:

$ while diff /proc/fs/ext4/<partition>/options options.txt; do true; done

This is also the cause of the following a crash while running xfstests
raspberrypi#234, as reported in the following bug reports:

	https://bugs.launchpad.net/bugs/1053019
	https://bugzilla.kernel.org/show_bug.cgi?id=47731

Signed-off-by: Herton Ronaldo Krzesinski <[email protected]>
Signed-off-by: "Theodore Ts'o" <[email protected]>
Cc: Brad Figg <[email protected]>
Cc: [email protected]
  • Loading branch information
Herton Ronaldo Krzesinski authored and tytso committed Sep 24, 2012
1 parent bef53b0 commit 50df9fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,7 @@ static inline void ext4_show_quota_options(struct seq_file *seq,

static const char *token2str(int token)
{
static const struct match_token *t;
const struct match_token *t;

for (t = tokens; t->token != Opt_err; t++)
if (t->token == token && !strchr(t->pattern, '='))
Expand Down

0 comments on commit 50df9fd

Please sign in to comment.