]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Consider target only for spare-same-domain
authorPrzemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Sun, 26 Dec 2010 11:38:44 +0000 (22:38 +1100)
committerNeilBrown <neilb@suse.de>
Sun, 26 Dec 2010 11:38:44 +0000 (22:38 +1100)
otherwise, matching target will force spare-same-domain regardless of
action that comes in domain.

Signed-off-by: NeilBrown <neilb@suse.de>
Incremental.c

index 90fc3739d9dbb11d5a0fd39396fa8406b3eedd9e..4ee198136f1c81efaf6d184102a6f1a633c95c82 100644 (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 &&