* [PATCH] fix del_timer() misuse for ->s_err_report
@ 2013-12-04 7:29 Al Viro
2013-12-09 1:56 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2013-12-04 7:29 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: linux-kernel, linux-ext4
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>
---
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index c977f4e..9d70c0c 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -792,7 +792,7 @@ static void ext4_put_super(struct super_block *sb)
}
ext4_es_unregister_shrinker(sbi);
- del_timer(&sbi->s_err_report);
+ del_timer_sync(&sbi->s_err_report);
ext4_release_system_zone(sb);
ext4_mb_release(sb);
ext4_ext_release(sb);
@@ -4184,7 +4184,7 @@ failed_mount_wq:
}
failed_mount3:
ext4_es_unregister_shrinker(sbi);
- del_timer(&sbi->s_err_report);
+ del_timer_sync(&sbi->s_err_report);
if (sbi->s_flex_groups)
ext4_kvfree(sbi->s_flex_groups);
percpu_counter_destroy(&sbi->s_freeclusters_counter);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: fix del_timer() misuse for ->s_err_report
2013-12-04 7:29 [PATCH] fix del_timer() misuse for ->s_err_report Al Viro
@ 2013-12-09 1:56 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2013-12-09 1:56 UTC (permalink / raw)
To: Al Viro; +Cc: linux-kernel, linux-ext4
On Wed, Dec 04, 2013 at 07:29:26AM +0000, Al Viro wrote:
> 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>
Nice catch. Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-12-09 1:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-04 7:29 [PATCH] fix del_timer() misuse for ->s_err_report Al Viro
2013-12-09 1:56 ` Theodore Ts'o
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).