public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Alasdair Kergon <agk@redhat.com>, Joe Thornber <ejt@redhat.com>
Cc: linux-raid@vger.kernel.org, dm-devel@redhat.com,
	kernel-janitors@vger.kernel.org,
	Mike Snitzer <snitzer@redhat.com>
Subject: [patch] dm thin: inverted down_trylock() test
Date: Tue, 25 Feb 2014 08:35:09 +0000	[thread overview]
Message-ID: <20140225083509.GB5023@elgon.mountain> (raw)

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);
 	}

             reply	other threads:[~2014-02-25  8:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25  8:35 Dan Carpenter [this message]
2014-02-25 12:49 ` dm thin: inverted down_trylock() test Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140225083509.GB5023@elgon.mountain \
    --to=dan.carpenter@oracle.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=ejt@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox