All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
To: songliubraving@fb.com
Cc: linux-raid@vger.kernel.org,
	Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Subject: [PATCH 4/5] md: flush md_rdev_misc_wq for HOT_ADD_DISK case
Date: Sat,  4 Apr 2020 23:57:10 +0200	[thread overview]
Message-ID: <20200404215711.4272-5-guoqing.jiang@cloud.ionos.com> (raw)
In-Reply-To: <20200404215711.4272-1-guoqing.jiang@cloud.ionos.com>

Since rdev->kobj is removed asynchronously, it is possible that the
rdev->kobj still exists when try to add the rdev again after rdev
is removed. But this path md_ioctl (HOT_ADD_DISK) -> hot_add_disk
-> bind_rdev_to_array missed it.

Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
---
 drivers/md/md.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index b4ea0f38ccd8..2bd2d91f2015 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7511,7 +7511,7 @@ static int md_ioctl(struct block_device *bdev, fmode_t mode,
 
 	}
 
-	if (cmd == ADD_NEW_DISK)
+	if (cmd == ADD_NEW_DISK || cmd == HOT_ADD_DISK)
 		flush_rdev_wq(mddev);
 
 	if (cmd == HOT_REMOVE_DISK)
-- 
2.17.1

  parent reply	other threads:[~2020-04-04 21:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04 21:57 [PATCH 0/4] md: fix lockdep warning Guoqing Jiang
2020-04-04 21:57 ` [PATCH 1/5] md: add checkings before flush md_misc_wq Guoqing Jiang
2020-04-04 21:57 ` [PATCH 2/5] md: add new workqueue for delete rdev Guoqing Jiang
2020-04-04 21:57 ` [PATCH 3/5] md: don't flush workqueue unconditionally in md_open Guoqing Jiang
2020-04-04 21:57 ` Guoqing Jiang [this message]
2020-04-04 21:57 ` [PATCH 5/5] md: remove the extra line for ->hot_add_disk Guoqing Jiang
2020-04-09  7:25 ` [PATCH 0/4] md: fix lockdep warning Song Liu
2020-04-09 21:47   ` Guoqing Jiang
2020-04-10  0:32     ` Song Liu
2020-04-10 22:34       ` Song Liu
2020-04-14  7:20         ` Guoqing Jiang

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=20200404215711.4272-5-guoqing.jiang@cloud.ionos.com \
    --to=guoqing.jiang@cloud.ionos.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=songliubraving@fb.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.