]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crush: ignore forcefed input that doesn't exist
authorSage Weil <sage.weil@dreamhost.com>
Fri, 2 Dec 2011 17:58:45 +0000 (09:58 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 2 Dec 2011 17:58:45 +0000 (09:58 -0800)
This might happen if, e.g., the file_layout specifies an osd that later
is removed from the cluster entirely.  Just ignore it instead of making
upper layers duplicate this check.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/crush/mapper.c

index 75656e1e0aec32877ecdea1ac409fa7421a357a0..e315aca1862d52bd4825487b9661b24bc2e79273 100644 (file)
@@ -495,10 +495,9 @@ int crush_do_rule(const struct crush_map *map,
                if (force >= map->max_devices ||
                    map->device_parents[force] == 0) {
                        /*dprintk("CRUSH: forcefed device dne\n");*/
-                       rc = -1;  /* force fed device dne */
-                       goto out;
+                       force = -1;  /* force fed device dne */
                }
-               if (!is_out(map, weight, force, x)) {
+               else if (!is_out(map, weight, force, x)) {
                        while (1) {
                                force_context[++force_pos] = force;
                                if (force >= 0)