Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] block: insert a general SMP memory barrier before wake_up_bit()
@ 2020-08-13  2:44 Jacob Wen
  2020-08-13  3:00 ` Chaitanya Kulkarni
  2020-08-13  7:31 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Jacob Wen @ 2020-08-13  2:44 UTC (permalink / raw)
  To: linux-fsdevel

wake_up_bit() uses waitqueue_active() that needs the explicit smp_mb().

Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
---
 fs/block_dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/block_dev.c b/fs/block_dev.c
index 0ae656e022fd..e74980848a2a 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1175,6 +1175,7 @@ static void bd_clear_claiming(struct block_device *whole, void *holder)
 	/* tell others that we're done */
 	BUG_ON(whole->bd_claiming != holder);
 	whole->bd_claiming = NULL;
+	smp_mb();
 	wake_up_bit(&whole->bd_claiming, 0);
 }
 
-- 
2.17.1


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

end of thread, other threads:[~2020-08-13 12:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13  2:44 [PATCH] block: insert a general SMP memory barrier before wake_up_bit() Jacob Wen
2020-08-13  3:00 ` Chaitanya Kulkarni
2020-08-13  7:31 ` Christoph Hellwig
2020-08-13  7:46   ` Jacob Wen
2020-08-13 11:40   ` peterz
2020-08-13 12:00     ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).