The forcefed mapping relies on a parent map. However, the current
implementation assumes that the parent mapping is unique for all rules. If
that is not the case (i.e., some osd exists in multiple hierarchies) then
we cannot assert that the TAKE matches the calculated force_context.
For now, we can just fail the mapping in that case (we don't use forcefed
mappings yet). The real solution is probably to define parent maps for
all possible hierarchies (i.e., starting at each unique TAKE starting
point).
Signed-off-by: Sage Weil <sage@newdream.net>
case CRUSH_RULE_TAKE:
w[0] = rule->steps[step].arg1;
if (force_pos >= 0) {
- BUG_ON(force_context[force_pos] != w[0]);
+ if (force_context[force_pos] != w[0]) {
+ rc = -1; /* forced mapping dne */
+ goto out;
+ }
force_pos--;
}
wsize = 1;