]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/ceph-kvstore-tool: fix segfaults when repair the rocksdb 43346/head
authorhuangjun <huangjun@xsky.com>
Wed, 29 Sep 2021 07:32:23 +0000 (15:32 +0800)
committerhuangjun <huangjun@xsky.com>
Wed, 29 Sep 2021 15:50:56 +0000 (23:50 +0800)
It will not set the db handler in repair process as it's not need
to open the db, that will cause db remains 0x0, then the db->repair() will
cause the segfault.

Fixes: https://tracker.ceph.com/issues/52756
Signed-off-by: huangjun <huangjun@xsky.com>
src/tools/kvstore_tool.cc

index 1e01b1792e775073a67337650b09307c0444b934..dfa600e83946a85f35862f47532cfb49f43876d2 100644 (file)
@@ -42,8 +42,8 @@ StoreTool::StoreTool(const string& type,
              << cpp_strerror(r) << std::endl;
         exit(1);
       }
-      db.reset(db_ptr);
     }
+    db.reset(db_ptr);
   }
 }