Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Jacob Wen <jian.w.wen@oracle.com>
To: linux-fsdevel@vger.kernel.org
Subject: [PATCH] block: insert a general SMP memory barrier before wake_up_bit()
Date: Thu, 13 Aug 2020 10:44:38 +0800	[thread overview]
Message-ID: <20200813024438.13170-1-jian.w.wen@oracle.com> (raw)

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


             reply	other threads:[~2020-08-13  2:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13  2:44 Jacob Wen [this message]
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

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=20200813024438.13170-1-jian.w.wen@oracle.com \
    --to=jian.w.wen@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --subject='Re: [PATCH] block: insert a general SMP memory barrier before wake_up_bit()' \
    /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

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).