aboutsummaryrefslogtreecommitdiffstats
path: root/net/ceph/crush/mapper.c
diff options
context:
space:
mode:
authorIlya Dryomov <ilya.dryomov@inktank.com>2013-12-24 14:19:25 -0500
committerIlya Dryomov <ilya.dryomov@inktank.com>2013-12-31 13:32:15 -0500
commitc6d98a603a02594f6ecf16d0a0af989ae9fa7abd (patch)
tree78984357ac4b19d53b8e51ad70c81be12d50e81c /net/ceph/crush/mapper.c
parente8ef19c4ad161768e1d8309d5ae18481c098eb81 (diff)
crush: return CRUSH_ITEM_UNDEF for failed placements with indep
For firstn mode, if we fail to make a valid placement choice, we just continue and return a short result to the caller. For indep mode, however, we need to make the position stable, and return an undefined value on failed placements to avoid shifting later results to the left. Reflects ceph.git commit b1d4dd4eb044875874a1d01c01c7d766db5d0a80. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph/crush/mapper.c')
-rw-r--r--net/ceph/crush/mapper.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c
index dcf48bc504ea..a8605245d190 100644
--- a/net/ceph/crush/mapper.c
+++ b/net/ceph/crush/mapper.c
@@ -455,8 +455,12 @@ reject:
455 } while (retry_descent); 455 } while (retry_descent);
456 456
457 if (skip_rep) { 457 if (skip_rep) {
458 dprintk("skip rep\n"); 458 if (firstn) {
459 continue; 459 dprintk("skip rep\n");
460 continue;
461 }
462 dprintk("undef rep, continuing\n");
463 item = CRUSH_ITEM_UNDEF;
460 } 464 }
461 465
462 dprintk("CHOOSE got %d\n", item); 466 dprintk("CHOOSE got %d\n", item);