summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-10-31 12:59:44 +1100
committerNeilBrown <neilb@suse.de>2011-10-31 12:59:44 +1100
commit7fcc7c8acf0fba44d19a713207af7e58267c1179 (patch)
treece4b03fa3dfc07fb19b4d6c3653ba41ec1f926db
parentd890fa2b0586b6177b119643ff66932127d58afa (diff)
downloadop-kernel-dev-7fcc7c8acf0fba44d19a713207af7e58267c1179.zip
op-kernel-dev-7fcc7c8acf0fba44d19a713207af7e58267c1179.tar.gz
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>
-rw-r--r--drivers/md/raid10.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 132c18e..c025a82 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1355,7 +1355,7 @@ static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
struct mirror_info *p = &conf->mirrors[mirror];
if (p->recovery_disabled == mddev->recovery_disabled)
continue;
- if (!p->rdev)
+ if (p->rdev)
continue;
disk_stack_limits(mddev->gendisk, rdev->bdev,
OpenPOWER on IntegriCloud