]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: return error if we can't set the new bucket's name
authorSage Weil <sage@inktank.com>
Mon, 15 Jul 2013 23:12:50 +0000 (16:12 -0700)
committerDan Mick <dan.mick@inktank.com>
Tue, 16 Jul 2013 22:14:01 +0000 (15:14 -0700)
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
src/mon/OSDMonitor.cc

index 7e76ea271c40dd95f8c8ff546d5ed5d2545a4f9d..8a3a4f0422bd44ae826626c67dec932cdcee7894 100644 (file)
@@ -2647,7 +2647,11 @@ bool OSDMonitor::prepare_command(MMonCommand *m)
     int bucketno = newcrush.add_bucket(0, CRUSH_BUCKET_STRAW,
                                       CRUSH_HASH_DEFAULT, type, 0, NULL,
                                       NULL);
-    newcrush.set_item_name(bucketno, name);
+    err = newcrush.set_item_name(bucketno, name);
+    if (err < 0) {
+      ss << "error setting bucket name to '" << name << "'";
+      goto reply;
+    }
 
     pending_inc.crush.clear();
     newcrush.encode(pending_inc.crush);