Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276639
b: refs/heads/master
c: f1932fc
h: refs/heads/master
i:
  276637: d849fca
  276635: 640a524
  276631: 6a9c0d0
  276623: 3042292
  276607: 53df5b3
v: v3
  • Loading branch information
Sage Weil committed Dec 12, 2011
1 parent 6613c9a commit db1267e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: be655596b3de5873f994ddbe205751a5ffb4de39
refs/heads/master: f1932fc1a6d899c754676b1dd8b17de93b052d43
35 changes: 13 additions & 22 deletions trunk/net/ceph/crush/mapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,6 @@ int crush_do_rule(struct crush_map *map,
int i, j;
int numrep;
int firstn;
int rc = -1;

BUG_ON(ruleno >= map->max_rules);

Expand All @@ -491,23 +490,18 @@ int crush_do_rule(struct crush_map *map,
* that this may or may not correspond to the specific types
* referenced by the crush rule.
*/
if (force >= 0) {
if (force >= map->max_devices ||
map->device_parents[force] == 0) {
/*dprintk("CRUSH: forcefed device dne\n");*/
rc = -1; /* force fed device dne */
goto out;
}
if (!is_out(map, weight, force, x)) {
while (1) {
force_context[++force_pos] = force;
if (force >= 0)
force = map->device_parents[force];
else
force = map->bucket_parents[-1-force];
if (force == 0)
break;
}
if (force >= 0 &&
force < map->max_devices &&
map->device_parents[force] != 0 &&
!is_out(map, weight, force, x)) {
while (1) {
force_context[++force_pos] = force;
if (force >= 0)
force = map->device_parents[force];
else
force = map->bucket_parents[-1-force];
if (force == 0)
break;
}
}

Expand Down Expand Up @@ -600,10 +594,7 @@ int crush_do_rule(struct crush_map *map,
BUG_ON(1);
}
}
rc = result_len;

out:
return rc;
return result_len;
}


0 comments on commit db1267e

Please sign in to comment.