From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: [patch] dm thin: inverted down_trylock() test Date: Tue, 25 Feb 2014 11:35:09 +0300 Message-ID: <20140225083509.GB5023@elgon.mountain> Reply-To: device-mapper development Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com To: Alasdair Kergon , Joe Thornber Cc: linux-raid@vger.kernel.org, dm-devel@redhat.com, kernel-janitors@vger.kernel.org, Mike Snitzer List-Id: linux-raid.ids 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 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); }