diff options
author | Sage Weil <sage@newdream.net> | 2011-12-12 09:35:22 -0800 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2012-01-10 08:56:57 -0800 |
commit | e11b05d31f21f0ea39ea288af667887cd6c21c80 (patch) | |
tree | 59768fe6ec9ef15f5e01817d76257f7489df1d5e /net/ceph | |
parent | 3d8eb7a94e8f25a33362f708974ac7daae9e84f8 (diff) | |
download | linux-3.10-e11b05d31f21f0ea39ea288af667887cd6c21c80.tar.gz linux-3.10-e11b05d31f21f0ea39ea288af667887cd6c21c80.tar.bz2 linux-3.10-e11b05d31f21f0ea39ea288af667887cd6c21c80.zip |
crush: fix force for non-root TAKE
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/crush/mapper.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index 3a94eae7abe..b79747c4b64 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, 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; |