Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280518
b: refs/heads/master
c: 56a2559
h: refs/heads/master
v: v3
  • Loading branch information
NeilBrown committed Dec 22, 2011
1 parent 0e19797 commit bedadf5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ca40c2ce099e4f1ce35445994f49836662596c8
refs/heads/master: 56a2559bb654ae2555b2ae3b29c837615d0c45c9
17 changes: 17 additions & 0 deletions trunk/drivers/md/raid10.c
Original file line number Diff line number Diff line change
Expand Up @@ -3201,6 +3201,16 @@ static int run(struct mddev *mddev)
continue;
disk = conf->mirrors + disk_idx;

if (test_bit(Replacement, &rdev->flags)) {
if (disk->replacement)
goto out_free_conf;
disk->replacement = rdev;
} else {
if (disk->rdev)
goto out_free_conf;
disk->rdev = rdev;
}

disk->rdev = rdev;
disk_stack_limits(mddev->gendisk, rdev->bdev,
rdev->data_offset << 9);
Expand Down Expand Up @@ -3228,6 +3238,13 @@ static int run(struct mddev *mddev)

disk = conf->mirrors + i;

if (!disk->rdev && disk->replacement) {
/* The replacement is all we have - use it */
disk->rdev = disk->replacement;
disk->replacement = NULL;
clear_bit(Replacement, &disk->rdev->flags);
}

if (!disk->rdev ||
!test_bit(In_sync, &disk->rdev->flags)) {
disk->head_position = 0;
Expand Down

0 comments on commit bedadf5

Please sign in to comment.