aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/crush/mapper.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-12-12 12:35:22 -0500
committerSage Weil <sage@newdream.net>2012-01-10 11:56:57 -0500
commite11b05d31f21f0ea39ea288af667887cd6c21c80 (patch)
tree59768fe6ec9ef15f5e01817d76257f7489df1d5e /net/ceph/crush/mapper.c
parent3d8eb7a94e8f25a33362f708974ac7daae9e84f8 (diff)
crush: fix force for non-root TAKE
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net/ceph/crush/mapper.c')
-rw-r--r--net/ceph/crush/mapper.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c
index 3a94eae7abe9..b79747c4b645 100644
--- a/net/ceph/crush/mapper.c
+++ b/net/ceph/crush/mapper.c
@@ -510,10 +510,15 @@ int crush_do_rule(struct crush_map *map,
510 switch (rule->steps[step].op) { 510 switch (rule->steps[step].op) {
511 case CRUSH_RULE_TAKE: 511 case CRUSH_RULE_TAKE:
512 w[0] = rule->steps[step].arg1; 512 w[0] = rule->steps[step].arg1;
513 if (force_pos >= 0) { 513
514 BUG_ON(force_context[force_pos] != w[0]); 514 /* find position in force_context/hierarchy */
515 while (force_pos >= 0 &&
516 force_context[force_pos] != w[0])
515 force_pos--; 517 force_pos--;
516 } 518 /* and move past it */
519 if (force_pos >= 0)
520 force_pos--;
521
517 wsize = 1; 522 wsize = 1;
518 break; 523 break;
519 524