lkml.org 
[lkml]   [2020]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] kthread_worker: Prevent queuing delayed work from timer_fn when it is being canceled
On Sun, Sep 27, 2020 at 01:54:49PM +0800, qiang.zhang@windriver.com wrote:
> From: Zqiang <qiang.zhang@windriver.com>
>
> There is a small race window when a delayed work is being canceled and
> the work still might be queued from the timer_fn:
>
> CPU0 CPU1
> kthread_cancel_delayed_work_sync()
> __kthread_cancel_work_sync()
> __kthread_cancel_work()
> work->canceling++;
> kthread_delayed_work_timer_fn()
> kthread_insert_work();
>
> BUG: kthread_insert_work() should not get called when work->canceling
> is set.
>
> Reviewed-by: Petr Mladek <pmladek@suse.com>
> Signed-off-by: Zqiang <qiang.zhang@windriver.com>

Acked-by: Tejun Heo <tj@kernel.org>

This prolly should go throgh -mm. Can you please also add a stable: tag?

Thanks.

--
tejun

\
 
 \ /
  Last update: 2020-09-30 17:57    [W:0.033 / U:4.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site