Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 1376512

Browse files
committed
md/raid10: fix bug which causes all RAID10 reshapes to move no data.
The recent comment: commit 7e83ccb 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: [email protected] (3.10) Cc: Martin Wilck <[email protected]> Signed-off-by: NeilBrown <[email protected]>
1 parent fdcfbbb commit 1376512

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/md/raid10.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,14 +2931,13 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr,
29312931
*/
29322932
if (mddev->bitmap == NULL &&
29332933
mddev->recovery_cp == MaxSector &&
2934+
mddev->reshape_position == MaxSector &&
2935+
!test_bit(MD_RECOVERY_SYNC, &mddev->recovery) &&
29342936
!test_bit(MD_RECOVERY_REQUESTED, &mddev->recovery) &&
2937+
!test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) &&
29352938
conf->fullsync == 0) {
29362939
*skipped = 1;
2937-
max_sector = mddev->dev_sectors;
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;
2940+
return mddev->dev_sectors - sector_nr;
29422941
}
29432942

29442943
skipped:

0 commit comments

Comments
 (0)