md/raid1: drop the redundant sysfs_unlink_rdev()
PATCH 1/1 md/raid1: drop the redundant sysfs_unlink_rdev()
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 <[email protected]>
---
drivers/md/raid1.c +0 -1
@@ -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);
Hi,
Quoted 6 lines · 在 2026/11/1 20:09, [email protected] 写道:
raid1_reshape()unlinks the old "rd{d}" link, assigns the newraid_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<[email protected]>
Applied, btw, patch format is a bit strange.
Signature · 2 lines
Thanks, Kuai