[PATCH 1/1] md: Do only necessary operations when adding device to RO array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit 8313b8e57f55b15e5b7f7fc5d1630bbf686a9a97 changed
way of adding device to read-only array. Used routine
md_reap_sync_thread() which also trigger finish_reshape(),
can break reshape process, if it was restarted.
This part of function should do only necessary operations, that is:
1) call ->spare_active
2) clear saved_raid_disk if array is no longer degraded

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@xxxxxxxxx>
Reviewed-by: Artur Paszkiewicz <artur.paszkiewicz@xxxxxxxxx>

---
drivers/md/md.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 237b7e0..cf073de2 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7820,11 +7820,13 @@ void md_check_recovery(struct mddev *mddev)
                                                * As we only add devices that are already in-sync,
                                                * we can activate the spares immediately.
                                                */
+                                             struct md_rdev *rdev;
                                               remove_and_add_spares(mddev, NULL);
-                                              /* There is no thread, but we need to call
-                                              * ->spare_active and clear saved_raid_disk
-                                              */
-                                              md_reap_sync_thread(mddev);
+                                             mddev->pers->spare_active(mddev);
+                                             rdev_for_each(rdev, mddev)
+                                                             if (!mddev->degraded ||
+                                                                 test_bit(In_sync, &rdev->flags))
+                                                                             rdev->saved_raid_disk = -1;
                                               clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
                                               goto unlock;
                               }
-- 
1.9.0
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux