All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm: add memory barrier before waitqueue_active
@ 2019-02-05 10:09 Mikulas Patocka
  2019-02-05 17:19 ` Mike Snitzer
  0 siblings, 1 reply; 6+ messages in thread
From: Mikulas Patocka @ 2019-02-05 10:09 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: dm-devel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-05 19:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-05 10:09 [PATCH] dm: add memory barrier before waitqueue_active Mikulas Patocka
2019-02-05 17:19 ` 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

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.