From 04c34e566760747029e3e4e932026021ab790c45 Mon Sep 17 00:00:00 2001 From: Sedat Dilek Date: Thu, 24 Sep 2015 01:48:23 +0200 Subject: [PATCH] workqueue: Move might_sleep() from start_flush_work() to __cancel_work_timer() --- kernel/workqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index ca71582fcfab..cff6bb7da334 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -2675,8 +2675,6 @@ static bool start_flush_work(struct work_struct *work, struct wq_barrier *barr) struct worker_pool *pool; struct pool_workqueue *pwq; - might_sleep(); - local_irq_disable(); pool = get_work_pool(work); if (!pool) { @@ -2766,6 +2764,8 @@ static bool __cancel_work_timer(struct work_struct *work, bool is_dwork) unsigned long flags; int ret; + might_sleep(); + do { ret = try_to_grab_pending(work, is_dwork, &flags); /* -- 2.5.3