aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-07-17 00:55:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-04 04:50:53 -0400
commit1d83ab8548ff19bad94dcae62ba13ea476974e7f (patch)
tree7723e5941a5d6419d7e0597c9ba5ad7412bd824e
parent943741e352f8b0c524f542b93e8b62978dc0a9b0 (diff)
md: Remove recent change which allows devices to skip recovery.
commit 5024c298311f3b97c85cb034f9edaa333fdb9338 upstream. commit 7ceb17e87bde79d285a8b988cfed9eaeebe60b86 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. Reported-by: Joe Lawrence <joe.lawrence@stratus.com> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/md/md.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 9b82377a833b..51f0345a4ba4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -7697,20 +7697,6 @@ static int remove_and_add_spares(struct mddev *mddev,
7697 continue; 7697 continue;
7698 7698
7699 rdev->recovery_offset = 0; 7699 rdev->recovery_offset = 0;
7700 if (rdev->saved_raid_disk >= 0 && mddev->in_sync) {
7701 spin_lock_irq(&mddev->write_lock);
7702 if (mddev->in_sync)
7703 /* OK, this device, which is in_sync,
7704 * will definitely be noticed before
7705 * the next write, so recovery isn't
7706 * needed.
7707 */
7708 rdev->recovery_offset = mddev->recovery_cp;
7709 spin_unlock_irq(&mddev->write_lock);
7710 }
7711 if (mddev->ro && rdev->recovery_offset != MaxSector)
7712 /* not safe to add this disk now */
7713 continue;
7714 if (mddev->pers-> 7700 if (mddev->pers->
7715 hot_add_disk(mddev, rdev) == 0) { 7701 hot_add_disk(mddev, rdev) == 0) {
7716 if (sysfs_link_rdev(mddev, rdev)) 7702 if (sysfs_link_rdev(mddev, rdev))