All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mikulas Patocka <mpatocka@redhat.com>
To: Mike Snitzer <msnitzer@redhat.com>
Cc: dm-devel@redhat.com
Subject: [PATCH] dm: add memory barrier before waitqueue_active
Date: Tue, 5 Feb 2019 05:09:00 -0500 (EST)	[thread overview]
Message-ID: <alpine.LRH.2.02.1902050506470.12231@file01.intranet.prod.int.rdu2.redhat.com> (raw)

Hi

Please submit patch this to Linus before 5.0 is released.

Mikulas



waitqueue_active without preceding barrier is unsafe, see the comment
before waitqueue_active definition in include/linux/wait.h.

This patch changes it to wq_has_sleeper.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: 6f75723190d8 ("dm: remove the pending IO accounting")

---
 drivers/md/dm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/md/dm.c
===================================================================
--- linux-2.6.orig/drivers/md/dm.c	2019-02-04 20:18:03.000000000 +0100
+++ linux-2.6/drivers/md/dm.c	2019-02-04 20:18:03.000000000 +0100
@@ -699,7 +699,7 @@ static void end_io_acct(struct dm_io *io
 				    true, duration, &io->stats_aux);
 
 	/* nudge anyone waiting on suspend queue */
-	if (unlikely(waitqueue_active(&md->wait)))
+	if (unlikely(wq_has_sleeper(&md->wait)))
 		wake_up(&md->wait);
 }
 

             reply	other threads:[~2019-02-05 10:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-05 10:09 Mikulas Patocka [this message]
2019-02-05 17:19 ` dm: add memory barrier before waitqueue_active Mike Snitzer
2019-02-05 17:56   ` Mikulas Patocka
2019-02-05 19:05     ` Mike Snitzer
2019-02-05 19:29       ` Mikulas Patocka
2019-02-05 19:58         ` 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=alpine.LRH.2.02.1902050506470.12231@file01.intranet.prod.int.rdu2.redhat.com \
    --to=mpatocka@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=msnitzer@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.