From db1267e0f63d434e1aac359056e6950c307ca271 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 7 Dec 2011 09:10:26 -0800 Subject: [PATCH] --- yaml --- r: 276639 b: refs/heads/master c: f1932fc1a6d899c754676b1dd8b17de93b052d43 h: refs/heads/master i: 276637: d849fcac6dc0e2a6307bcc3779f14bbb959d1d0f 276635: 640a524e0123ab6efd74ee943f930c45052e16bf 276631: 6a9c0d071f3ac264b32a4810d7d68634188aad81 276623: 30422924ee5b8fa40046fbc6725803e0d0f96cec 276607: 53df5b3927dcf5b0d48598703961628512e46ef5 v: v3 --- [refs] | 2 +- trunk/net/ceph/crush/mapper.c | 35 +++++++++++++---------------------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/[refs] b/[refs] index 672deb1e5350..dba519614f94 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: be655596b3de5873f994ddbe205751a5ffb4de39 +refs/heads/master: f1932fc1a6d899c754676b1dd8b17de93b052d43 diff --git a/trunk/net/ceph/crush/mapper.c b/trunk/net/ceph/crush/mapper.c index 42599e31dcad..3a94eae7abe9 100644 --- a/trunk/net/ceph/crush/mapper.c +++ b/trunk/net/ceph/crush/mapper.c @@ -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); @@ -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; } } @@ -600,10 +594,7 @@ int crush_do_rule(struct crush_map *map, BUG_ON(1); } } - rc = result_len; - -out: - return rc; + return result_len; }