aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid10.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-07-04 02:41:53 -0400
committerNeilBrown <neilb@suse.de>2013-07-04 02:42:57 -0400
commit1376512065b23f39d5f9a160948f313397dde972 (patch)
tree271ff9fe2a1616b45b24457e37b7088c4fd2923c /drivers/md/raid10.c
parentfdcfbbb653b27964c4daa4d2bcb364259c257e7d (diff)
md/raid10: fix bug which causes all RAID10 reshapes to move no data.
The recent comment: commit 7e83ccbecd608b971f340e951c9e84cd0343002f md/raid10: Allow skipping recovery when clean arrays are assembled Causes raid10 to skip a recovery in certain cases where it is safe to do so. Unfortunately it also causes a reshape to be skipped which is never safe. The result is that an attempt to reshape a RAID10 will appear to complete instantly, but no data will have been moves so the array will now contain garbage. (If nothing is written, you can recovery by simple performing the reverse reshape which will also complete instantly). Bug was introduced in 3.10, so this is suitable for 3.10-stable. Cc: stable@vger.kernel.org (3.10) Cc: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r--drivers/md/raid10.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 3480bf7c20d4..cd066b63bdaf 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -2931,14 +2931,13 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
2931 */ 2931 */
2932 if (mddev->bitmap == NULL && 2932 if (mddev->bitmap == NULL &&
2933 mddev->recovery_cp == MaxSector && 2933 mddev->recovery_cp == MaxSector &&
2934 mddev->reshape_position == MaxSector &&
2935 !test_bit(MD_RECOVERY_SYNC, &mddev->recovery) &&
2934 !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) && 2936 !test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
2937 !test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) &&
2935 conf->fullsync == 0) { 2938 conf->fullsync == 0) {
2936 *skipped = 1; 2939 *skipped = 1;
2937 max_sector = mddev->dev_sectors; 2940 return mddev->dev_sectors - sector_nr;
2938 if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery) ||
2939 test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery))
2940 max_sector = mddev->resync_max_sectors;
2941 return max_sector - sector_nr;
2942 } 2941 }
2943 2942
2944 skipped: 2943 skipped: