]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/cephfs: check rados.connect() result before goes on 9507/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 6 Jun 2016 01:58:08 +0000 (09:58 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 6 Jun 2016 02:19:55 +0000 (10:19 +0800)
Which can fail.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/tools/cephfs/JournalTool.cc

index 63e5ac11089553e8fdbe614ef3ec4f8c036d74ba..867f81638bdef111aa4b15e2bf7988cd9b1ef830 100644 (file)
@@ -112,7 +112,11 @@ int JournalTool::main(std::vector<const char*> &argv)
   }
 
   dout(4) << "JournalTool: connecting to RADOS..." << dendl;
-  rados.connect();
+  r = rados.connect();
+  if (r < 0) {
+    derr << "couldn't connect to cluster: " << cpp_strerror(r) << dendl;
+    return r;
+  }
  
   auto fs = fsmap->get_filesystem(role_selector.get_ns());
   assert(fs != nullptr);