diff options
author | Al Viro <viro@ZenIV.linux.org.uk> | 2013-12-08 20:52:31 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-12-08 20:52:31 -0500 |
commit | 9105bb149bbbc555d2e11ba5166dfe7a24eae09e (patch) | |
tree | 39be8d3d708388d52fcae98dd307a60194cc03f8 | |
parent | 5946d089379a35dda0e531710b48fca05446a196 (diff) |
ext4: fix del_timer() misuse for ->s_err_report
That thing should be del_timer_sync(); consider what happens
if ext4_put_super() call of del_timer() happens to come just as it's
getting run on another CPU. Since that timer reschedules itself
to run next day, you are pretty much guaranteed that you'll end up
with kfree'd scheduled timer, with usual fun consequences. AFAICS,
that's -stable fodder all way back to 2010... [the second del_timer_sync()
is almost certainly not needed, but it doesn't hurt either]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: stable@vger.kernel.org
-rw-r--r-- | fs/ext4/super.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c977f4e4e63b..9d70c0c177c7 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -792,7 +792,7 @@ static void ext4_put_super(struct super_block *sb) | |||
792 | } | 792 | } |
793 | 793 | ||
794 | ext4_es_unregister_shrinker(sbi); | 794 | ext4_es_unregister_shrinker(sbi); |
795 | del_timer(&sbi->s_err_report); | 795 | del_timer_sync(&sbi->s_err_report); |
796 | ext4_release_system_zone(sb); | 796 | ext4_release_system_zone(sb); |
797 | ext4_mb_release(sb); | 797 | ext4_mb_release(sb); |
798 | ext4_ext_release(sb); | 798 | ext4_ext_release(sb); |
@@ -4184,7 +4184,7 @@ failed_mount_wq: | |||
4184 | } | 4184 | } |
4185 | failed_mount3: | 4185 | failed_mount3: |
4186 | ext4_es_unregister_shrinker(sbi); | 4186 | ext4_es_unregister_shrinker(sbi); |
4187 | del_timer(&sbi->s_err_report); | 4187 | del_timer_sync(&sbi->s_err_report); |
4188 | if (sbi->s_flex_groups) | 4188 | if (sbi->s_flex_groups) |
4189 | ext4_kvfree(sbi->s_flex_groups); | 4189 | ext4_kvfree(sbi->s_flex_groups); |
4190 | percpu_counter_destroy(&sbi->s_freeclusters_counter); | 4190 | percpu_counter_destroy(&sbi->s_freeclusters_counter); |