Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e11b05d3 authored by Sage Weil's avatar Sage Weil
Browse files

crush: fix force for non-root TAKE



Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 3d8eb7a9
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -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;