This is a note to let you know that I've just added the patch titled md: Fix skipping recovery for read-only arrays. to the 3.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: md-fix-skipping-recovery-for-read-only-arrays.patch and it can be found in the queue-3.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 61e4947c99c4494336254ec540c50186d186150b Mon Sep 17 00:00:00 2001 From: Lukasz Dorau <lukasz.dorau@xxxxxxxxx> Date: Thu, 24 Oct 2013 12:55:17 +1100 Subject: md: Fix skipping recovery for read-only arrays. From: Lukasz Dorau <lukasz.dorau@xxxxxxxxx> commit 61e4947c99c4494336254ec540c50186d186150b upstream. Since: commit 7ceb17e87bde79d285a8b988cfed9eaeebe60b86 md: Allow devices to be re-added to a read-only array. spares are activated on a read-only array. In case of raid1 and raid10 personalities it causes that not-in-sync devices are marked in-sync without checking if recovery has been finished. If a read-only array is degraded and one of its devices is not in-sync (because the array has been only partially recovered) recovery will be skipped. This patch adds checking if recovery has been finished before marking a device in-sync for raid1 and raid10 personalities. In case of raid5 personality such condition is already present (at raid5.c:6029). Bug was introduced in 3.10 and causes data corruption. Signed-off-by: Pawel Baldysiak <pawel.baldysiak@xxxxxxxxx> Signed-off-by: Lukasz Dorau <lukasz.dorau@xxxxxxxxx> Signed-off-by: NeilBrown <neilb@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/md/raid1.c | 1 + drivers/md/raid10.c | 1 + 2 files changed, 2 insertions(+) --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1357,6 +1357,7 @@ static int raid1_spare_active(struct mdd } } if (rdev + && rdev->recovery_offset == MaxSector && !test_bit(Faulty, &rdev->flags) && !test_and_set_bit(In_sync, &rdev->flags)) { count++; --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -1534,6 +1534,7 @@ static int raid10_spare_active(struct md } sysfs_notify_dirent_safe(tmp->replacement->sysfs_state); } else if (tmp->rdev + && tmp->rdev->recovery_offset == MaxSector && !test_bit(Faulty, &tmp->rdev->flags) && !test_and_set_bit(In_sync, &tmp->rdev->flags)) { count++; Patches currently in stable-queue which might be from lukasz.dorau@xxxxxxxxx are queue-3.4/md-fix-skipping-recovery-for-read-only-arrays.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html