From: huangjun Date: Wed, 29 Sep 2021 07:32:23 +0000 (+0800) Subject: tools/ceph-kvstore-tool: fix segfaults when repair the rocksdb X-Git-Tag: v17.1.0~725^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=28948358227d239ea3e8946601f9f54e3a790c08;p=ceph.git tools/ceph-kvstore-tool: fix segfaults when repair the rocksdb 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 --- diff --git a/src/tools/kvstore_tool.cc b/src/tools/kvstore_tool.cc index 1e01b1792e7..dfa600e8394 100644 --- a/src/tools/kvstore_tool.cc +++ b/src/tools/kvstore_tool.cc @@ -42,8 +42,8 @@ StoreTool::StoreTool(const string& type, << cpp_strerror(r) << std::endl; exit(1); } - db.reset(db_ptr); } + db.reset(db_ptr); } }