* [patch] dm thin: inverted down_trylock() test
@ 2014-02-25 8:35 Dan Carpenter
2014-02-25 12:49 ` Mike Snitzer
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-02-25 8:35 UTC (permalink / raw)
To: Alasdair Kergon, Joe Thornber
Cc: linux-raid, dm-devel, kernel-janitors, Mike Snitzer
down_trylock() is the opposite of mutex_trylock(). It returns zero on
success and one on failure.
Fixes: f4ef95631ebf ('dm thin: do not run the worker thread if pool is suspended')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 6cbe9d2e0385..7d8e03c21fa9 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -237,7 +237,7 @@ struct thin_c {
*/
static void wake_worker(struct pool *pool)
{
- if (down_trylock(&pool->queue_work_lock)) {
+ if (!down_trylock(&pool->queue_work_lock)) {
queue_work(pool->wq, &pool->worker);
up(&pool->queue_work_lock);
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: dm thin: inverted down_trylock() test
2014-02-25 8:35 [patch] dm thin: inverted down_trylock() test Dan Carpenter
@ 2014-02-25 12:49 ` Mike Snitzer
0 siblings, 0 replies; 2+ messages in thread
From: Mike Snitzer @ 2014-02-25 12:49 UTC (permalink / raw)
To: Dan Carpenter
Cc: Alasdair Kergon, Joe Thornber, dm-devel, Neil Brown, linux-raid,
kernel-janitors
On Tue, Feb 25 2014 at 3:35am -0500,
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> down_trylock() is the opposite of mutex_trylock(). It returns zero on
> success and one on failure.
>
> Fixes: f4ef95631ebf ('dm thin: do not run the worker thread if pool is suspended')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Thanks for the fix, but that commit has since been dropped.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-02-25 12:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-25 8:35 [patch] dm thin: inverted down_trylock() test Dan Carpenter
2014-02-25 12:49 ` Mike Snitzer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox