]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/ceph-kvstore-tool: fix segfaults when repair the rocksdb 51254/head
authorhuangjun <huangjun@xsky.com>
Wed, 29 Sep 2021 07:32:23 +0000 (15:32 +0800)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Thu, 27 Apr 2023 10:50:22 +0000 (17:50 +0700)
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>
(cherry picked from commit 28948358227d239ea3e8946601f9f54e3a790c08)

src/tools/kvstore_tool.cc

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