From 8398f8218217d7d54976a011104ff51cbdd98ed7 Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Wed, 6 Feb 2013 18:04:53 -0800 Subject: [PATCH] --- yaml --- r: 350293 b: refs/heads/master c: 038366c5cf23ae737b9f72169dd8ade2d105755b h: refs/heads/master i: 350291: d851e311c26c5779f1fd344ef33972323c15d4ee v: v3 --- [refs] | 2 +- trunk/kernel/workqueue.c | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 96ab11c330a9..767db5121657 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6be195886ac26abe0194ed1bc7a9224f8a97c310 +refs/heads/master: 038366c5cf23ae737b9f72169dd8ade2d105755b diff --git a/trunk/kernel/workqueue.c b/trunk/kernel/workqueue.c index 7e11334a119f..a229a56f3a32 100644 --- a/trunk/kernel/workqueue.c +++ b/trunk/kernel/workqueue.c @@ -3443,8 +3443,6 @@ EXPORT_SYMBOL_GPL(workqueue_congested); * Test whether @work is currently pending or running. There is no * synchronization around this function and the test result is * unreliable and only useful as advisory hints or for debugging. - * Especially for reentrant wqs, the pending state might hide the - * running state. * * RETURNS: * OR'd bitmask of WORK_BUSY_* bits. @@ -3455,17 +3453,15 @@ unsigned int work_busy(struct work_struct *work) unsigned long flags; unsigned int ret = 0; - if (!pool) - return 0; - - spin_lock_irqsave(&pool->lock, flags); - if (work_pending(work)) ret |= WORK_BUSY_PENDING; - if (find_worker_executing_work(pool, work)) - ret |= WORK_BUSY_RUNNING; - spin_unlock_irqrestore(&pool->lock, flags); + if (pool) { + spin_lock_irqsave(&pool->lock, flags); + if (find_worker_executing_work(pool, work)) + ret |= WORK_BUSY_RUNNING; + spin_unlock_irqrestore(&pool->lock, flags); + } return ret; }