Skip to content

Commit 5024c29

Browse files
committed
md: Remove recent change which allows devices to skip recovery.
commit 7ceb17e md: Allow devices to be re-added to a read-only array. allowed a bit more than just that. It also allows devices to be added to a read-write array and to end up skipping recovery. This patch removes the offending piece of code pending a rewrite for a subsequent release. More specifically: If the array has a bitmap, then the device will still need a bitmap based resync ('saved_raid_disk' is set under different conditions is a bitmap is present). If the array doesn't have a bitmap, then this is correct as long as nothing has been written to the array since the metadata was checked by ->validate_super. However there is no locking to ensure that there was no write. Bug was introduced in 3.10 and causes data corruption so patch is suitable for 3.10-stable. Cc: [email protected] (3.10) Reported-by: Joe Lawrence <[email protected]> Signed-off-by: NeilBrown <[email protected]>
1 parent 7bb23c4 commit 5024c29

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

drivers/md/md.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7716,20 +7716,6 @@ static int remove_and_add_spares(struct mddev *mddev,
77167716
continue;
77177717

77187718
rdev->recovery_offset = 0;
7719-
if (rdev->saved_raid_disk >= 0 && mddev->in_sync) {
7720-
spin_lock_irq(&mddev->write_lock);
7721-
if (mddev->in_sync)
7722-
/* OK, this device, which is in_sync,
7723-
* will definitely be noticed before
7724-
* the next write, so recovery isn't
7725-
* needed.
7726-
*/
7727-
rdev->recovery_offset = mddev->recovery_cp;
7728-
spin_unlock_irq(&mddev->write_lock);
7729-
}
7730-
if (mddev->ro && rdev->recovery_offset != MaxSector)
7731-
/* not safe to add this disk now */
7732-
continue;
77337719
if (mddev->pers->
77347720
hot_add_disk(mddev, rdev) == 0) {
77357721
if (sysfs_link_rdev(mddev, rdev))

0 commit comments

Comments
 (0)