From: xie xingguo Date: Thu, 7 Jan 2016 11:17:34 +0000 (+0800) Subject: CrushTool: exit if fail to add a bucket X-Git-Tag: v10.0.3~32^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db2e21ca253b72abb38112ce208d1e99514f9412;p=ceph.git CrushTool: exit if fail to add a bucket Signed-off-by: xie xingguo --- diff --git a/src/tools/crushtool.cc b/src/tools/crushtool.cc index 510d28de323c..1e56c6327f47 100644 --- a/src/tools/crushtool.cc +++ b/src/tools/crushtool.cc @@ -643,7 +643,7 @@ int main(int argc, const char **argv) break; } if (buckettype < 0) { - cerr << "unknown bucket type '" << l.buckettype << "'" << std::endl << std::endl; + cerr << "unknown bucket type '" << l.buckettype << "'" << std::endl; exit(EXIT_FAILURE); } @@ -678,8 +678,9 @@ int main(int argc, const char **argv) int id; int r = crush.add_bucket(0, buckettype, CRUSH_HASH_DEFAULT, type, j, items, weights, &id); if (r < 0) { - dout(2) << "Couldn't add bucket: " << cpp_strerror(r) << dendl; - } + cerr << " Couldn't add bucket: " << cpp_strerror(r) << std::endl; + return r; + } char format[20]; format[sizeof(format)-1] = '\0';