* [PATCH] md/raid1: drop the redundant sysfs_unlink_rdev()
@ 2026-11-01 12:09 shao.mingyin
2026-11-21 3:58 ` yu kuai
0 siblings, 1 reply; 2+ messages in thread
From: shao.mingyin @ 2026-11-01 12:09 UTC (permalink / raw)
To: song, yukuai, linux-raid; +Cc: magiclinan, xiao, linux-kernel
raid1_reshape() unlinks the old "rd{d}" link, assigns the new
raid_disk, then unlinks again. The second call targets "rd{d2}", a slot
that has no sysfs link yet, so it is a no-op; sysfs_link_rdev() below
creates it.
Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 894efb50c6d5..25b80ad52f00 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -3351,7 +3351,6 @@ static int raid1_reshape(struct mddev *mddev)
if (rdev && rdev->raid_disk != d2) {
sysfs_unlink_rdev(mddev, rdev);
rdev->raid_disk = d2;
- sysfs_unlink_rdev(mddev, rdev);
if (sysfs_link_rdev(mddev, rdev))
pr_warn("md/raid1:%s: cannot register rd%d\n",
mdname(mddev), rdev->raid_disk);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] md/raid1: drop the redundant sysfs_unlink_rdev()
2026-11-01 12:09 [PATCH] md/raid1: drop the redundant sysfs_unlink_rdev() shao.mingyin
@ 2026-11-21 3:58 ` yu kuai
0 siblings, 0 replies; 2+ messages in thread
From: yu kuai @ 2026-11-21 3:58 UTC (permalink / raw)
To: shao.mingyin, song, linux-raid, yu kuai; +Cc: magiclinan, xiao, linux-kernel
Hi,
在 2026/11/1 20:09, shao.mingyin@zte.com.cn 写道:
> raid1_reshape() unlinks the old "rd{d}" link, assigns the new
> raid_disk, then unlinks again. The second call targets "rd{d2}", a slot
> that has no sysfs link yet, so it is a no-op; sysfs_link_rdev() below
> creates it.
>
> Signed-off-by: Shao Mingyin<shao.mingyin@zte.com.cn>
Applied, btw, patch format is a bit strange.
--
Thanks,
Kuai
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-21 3:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-01 12:09 [PATCH] md/raid1: drop the redundant sysfs_unlink_rdev() shao.mingyin
2026-11-21 3:58 ` yu kuai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®