]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
CrushTool: exit if fail to add a bucket
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 7 Jan 2016 11:17:34 +0000 (19:17 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 12 Jan 2016 08:07:30 +0000 (16:07 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/tools/crushtool.cc

index 510d28de323cea77478be4d66622ab4325188213..1e56c6327f475780bdc15c0f2e3e410698070927 100644 (file)
@@ -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';