From: Xiao Ni <xni@redhat.com>
To: linux-raid@vger.kernel.org
Cc: yukuai3@huawei.com, song@kernel.org, ncroxon@redhat.com
Subject: [PATCH 3/3] md: remove/add redundancy group only in level change
Date: Tue, 3 Jun 2025 13:20:23 +0800 [thread overview]
Message-ID: <20250603052023.7922-4-xni@redhat.com> (raw)
In-Reply-To: <20250603052023.7922-1-xni@redhat.com>
del_gendisk is called in synchronous way now. So it doesn't need to handle
redundancy group separately.
Signed-off-by: Xiao Ni <xni@redhat.com>
---
drivers/md/md.c | 29 ++++++++++-------------------
1 file changed, 10 insertions(+), 19 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0913b8236471..84cd21bd85b0 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -818,23 +818,16 @@ void mddev_unlock(struct mddev *mddev)
mddev->sysfs_active = 1;
mutex_unlock(&mddev->reconfig_mutex);
- if (mddev->kobj.sd) {
- if (to_remove != &md_redundancy_group)
- sysfs_remove_group(&mddev->kobj, to_remove);
- if (mddev->pers == NULL ||
- mddev->pers->sync_request == NULL) {
- sysfs_remove_group(&mddev->kobj, &md_redundancy_group);
- if (mddev->sysfs_action)
- sysfs_put(mddev->sysfs_action);
- if (mddev->sysfs_completed)
- sysfs_put(mddev->sysfs_completed);
- if (mddev->sysfs_degraded)
- sysfs_put(mddev->sysfs_degraded);
- mddev->sysfs_action = NULL;
- mddev->sysfs_completed = NULL;
- mddev->sysfs_degraded = NULL;
- }
- }
+ sysfs_remove_group(&mddev->kobj, to_remove);
+ if (mddev->sysfs_action)
+ sysfs_put(mddev->sysfs_action);
+ if (mddev->sysfs_completed)
+ sysfs_put(mddev->sysfs_completed);
+ if (mddev->sysfs_degraded)
+ sysfs_put(mddev->sysfs_degraded);
+ mddev->sysfs_action = NULL;
+ mddev->sysfs_completed = NULL;
+ mddev->sysfs_degraded = NULL;
mddev->sysfs_active = 0;
} else
mutex_unlock(&mddev->reconfig_mutex);
@@ -6475,8 +6468,6 @@ static void __md_stop(struct mddev *mddev)
if (mddev->private)
pers->free(mddev, mddev->private);
mddev->private = NULL;
- if (pers->sync_request && mddev->to_remove == NULL)
- mddev->to_remove = &md_redundancy_group;
put_pers(pers);
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
--
2.32.0 (Apple Git-132)
next prev parent reply other threads:[~2025-06-03 5:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 5:20 [PATCH V3 0/2] md: call del_gendisk in sync way Xiao Ni
2025-06-03 5:20 ` [PATCH 1/3] md: call del_gendisk in control path Xiao Ni
2025-06-03 5:20 ` [PATCH 2/3] md: Don't clear MD_CLOSING until mddev is freed Xiao Ni
2025-06-03 5:20 ` Xiao Ni [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-06-04 9:07 [PATCH V4 0/3] md: call del_gendisk in sync way Xiao Ni
2025-06-04 9:07 ` [PATCH 3/3] md: remove/add redundancy group only in level change Xiao Ni
2025-06-10 7:20 [PATCH V5 0/3] md: call del_gendisk in sync way Xiao Ni
2025-06-10 7:20 ` [PATCH 3/3] md: remove/add redundancy group only in level change Xiao Ni
2025-06-11 6:17 ` Yu Kuai
2025-06-11 7:31 [PATCH V6 0/3] md: call del_gendisk in sync way Xiao Ni
2025-06-11 7:31 ` [PATCH 3/3] md: remove/add redundancy group only in level change Xiao Ni
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=20250603052023.7922-4-xni@redhat.com \
--to=xni@redhat.com \
--cc=linux-raid@vger.kernel.org \
--cc=ncroxon@redhat.com \
--cc=song@kernel.org \
--cc=yukuai3@huawei.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 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).