Consider target only for spare-same-domain

otherwise, matching target will force spare-same-domain regardless of
action that comes in domain.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Przemyslaw Czarnowski 2010-12-26 22:38:44 +11:00 committed by NeilBrown
parent 4886570497
commit fee6a49ee8
1 changed files with 2 additions and 1 deletions

View File

@ -978,7 +978,8 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
* array which matches 'target'.
* target is considered only if we deal with degraded array
*/
if (target) {
if (target && policy_action_allows(pol, st2->ss->name,
act_spare_same_slot)) {
if (strcmp(target->metadata, mp->metadata) == 0 &&
memcmp(target->uuid, mp->uuid,
sizeof(target->uuid)) == 0 &&