diff options
author | Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> | 2010-12-26 22:33:14 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2010-12-26 22:33:14 +1100 |
commit | b4924220f1ab5ae078287411058ec5294e360e2d (patch) | |
tree | 54a66ac503714f2c9360126a15e2a8917cbb8915 /Incremental.c | |
parent | 5be68a0762f479724da5e579c2b8fbf9f6a28d6a (diff) |
Added test for array degradation for spare-same-slot
spare-same-slot allows re-adding of missing array member with disk
re-inserted into the same slot where previous member was plugged in.
If in the meantime another spare has been used for recovery, same slot
cookie should be ignored.
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r-- | Incremental.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Incremental.c b/Incremental.c index 6ff64f3a..ee476dab 100644 --- a/Incremental.c +++ b/Incremental.c @@ -966,11 +966,13 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol, * arrays/containers that match 'target'. * If 'target' is set and 'bare' is true, we prefer the * array which matches 'target'. + * target is considered only if we deal with degraded array */ if (target) { if (strcmp(target->metadata, mp->metadata) == 0 && memcmp(target->uuid, mp->uuid, - sizeof(target->uuid)) == 0) { + sizeof(target->uuid)) == 0 && + sra->array.failed_disks > 0) { /* This is our target!! */ if (chosen) sysfs_free(chosen); |