summaryrefslogtreecommitdiff
path: root/Incremental.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-11-22 20:58:06 +1100
committerNeilBrown <neilb@suse.de>2010-11-22 20:58:06 +1100
commit625b25071bb6db4d1c019d5bab0344d82d5ae4c4 (patch)
tree450e148e56b5dced5467e54a192ade9cfffbd9e5 /Incremental.c
parent6e57f80a9005ab354ce7602b3ce0c7d7a0d239cb (diff)
incr/spare: recheck allowed action for each metadata.
The current act_spare tests only test if it is allowed for some metadata. As we check each array or partitioning type, we need to double-check that sparing is allowed for that array or partitioning type. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Incremental.c')
-rw-r--r--Incremental.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Incremental.c b/Incremental.c
index de7fa6f0..3e361d0a 100644
--- a/Incremental.c
+++ b/Incremental.c
@@ -827,6 +827,11 @@ static int array_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
devname, mp->path);
goto next;
}
+ /* Need to double check the 'act_spare' permissions applies
+ * to this metadata.
+ */
+ if (!policy_action_allows(pol, st2->ss->name, act_spare))
+ goto next;
} else
st2 = st;
get_dev_size(dfd, NULL, &devsize);
@@ -981,6 +986,11 @@ static int partition_try_spare(char *devname, int *dfdp, struct dev_policy *pol,
if (domain_test(domlist, pol, st2->ss->name) == 0)
/* Incompatible devices for this metadata type */
goto next;
+ if (!policy_action_allows(pol, st2->ss->name, act_spare))
+ /* Some partition types allow sparing, but not
+ * this one.
+ */
+ goto next;
}
st2->ss->getinfo_super(st2, &info, NULL);