Commit 7fcc7c8acf0fba44d19a713207af7e58267c1179

Authored by NeilBrown
1 parent d890fa2b05

md/raid10: Fix bug when activating a hot-spare.

This is a fairly serious bug in RAID10.

When a RAID10 array is degraded and a hot-spare is activated, the
spare does not take up the empty slot, but rather replaces the first
working device.
This is likely to make the array non-functional.   It would normally
be possible to recover the data, but that would need care and is not
guaranteed.

This bug was introduced in commit
   2bb77736ae5dca0a189829fbb7379d43364a9dac
which first appeared in 3.1.

Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -1355,7 +1355,7 @@
1355 1355 struct mirror_info *p = &conf->mirrors[mirror];
1356 1356 if (p->recovery_disabled == mddev->recovery_disabled)
1357 1357 continue;
1358   - if (!p->rdev)
  1358 + if (p->rdev)
1359 1359 continue;
1360 1360  
1361 1361 disk_stack_limits(mddev->gendisk, rdev->bdev,