summaryrefslogtreecommitdiffstats
path: root/src/mon
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2014-03-05 22:15:58 +0100
committerSage Weil <sage@inktank.com>2014-03-05 22:15:58 +0100
commit772968e60ba6e0c1ce49b18fbb6d3f2fb7474373 (patch)
treeeaacfde77908c269b5c9a5c96dbeace62b80a1b9 /src/mon
parentqa/workunits/mon/crush_ops: use expect_false (diff)
downloadceph-772968e60ba6e0c1ce49b18fbb6d3f2fb7474373.tar.xz
ceph-772968e60ba6e0c1ce49b18fbb6d3f2fb7474373.zip
mon/OSDMonitor: disallow crush buckets of type 0
Prevent creation of buckets of type 0 ('osd', 'device', etc.), as they will confusing the mapping algorithm. Signed-off-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'src/mon')
-rw-r--r--src/mon/OSDMonitor.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index 7ad68c4ee15..0ebc31a7044 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -3428,6 +3428,11 @@ bool OSDMonitor::prepare_command_impl(MMonCommand *m,
err = -EINVAL;
goto reply;
}
+ if (type == 0) {
+ ss << "type '" << typestr << "' is for devices, not buckets";
+ err = -EINVAL;
+ goto reply;
+ }
int bucketno;
err = newcrush.add_bucket(0, CRUSH_BUCKET_STRAW,
CRUSH_HASH_DEFAULT, type, 0, NULL,