]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/filestore: add sanity check for omap_store initializing
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 16 Jun 2016 01:20:46 +0000 (09:20 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 16 Jun 2016 01:29:15 +0000 (09:29 +0800)
Which can fail.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/os/filestore/FileStore.cc

index 6ccbf9002174722d8bac0cca7b1d5e6707e1b08c..39f48061e08a6144ff4974528cffb8da6c606175 100644 (file)
@@ -1625,9 +1625,14 @@ int FileStore::mount()
     }
 
     if (superblock.omap_backend == "rocksdb")
-      omap_store->init(g_conf->filestore_rocksdb_options);
+      ret = omap_store->init(g_conf->filestore_rocksdb_options);
     else
-      omap_store->init();
+      ret = omap_store->init();
+
+    if (ret < 0) {
+      derr << "Error initializing omap_store: " << cpp_strerror(ret) << dendl;
+      goto close_current_fd;
+    }
 
     stringstream err;
     if (omap_store->create_and_open(err)) {