[patch] dm thin: inverted down_trylock() test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>

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);
 	}
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux