Skip to content

Commit

Permalink
crush: fix force for non-root TAKE
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Jan 10, 2012
1 parent 3d8eb7a commit e11b05d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions net/ceph/crush/mapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,15 @@ int crush_do_rule(struct crush_map *map,
switch (rule->steps[step].op) {
case CRUSH_RULE_TAKE:
w[0] = rule->steps[step].arg1;
if (force_pos >= 0) {
BUG_ON(force_context[force_pos] != w[0]);

/* find position in force_context/hierarchy */
while (force_pos >= 0 &&
force_context[force_pos] != w[0])
force_pos--;
}
/* and move past it */
if (force_pos >= 0)
force_pos--;

wsize = 1;
break;

Expand Down

0 comments on commit e11b05d

Please sign in to comment.