From 3f5d51ac3c2035b4bd715f807fc210f8e00844fd Mon Sep 17 00:00:00 2001 From: liuchang0812 Date: Mon, 31 Jul 2017 11:06:58 +0800 Subject: [PATCH] os/bluestore: clear result in BlueRocksEnv::getChildren see https://github.com/facebook/rocksdb/blob/master/env/env_posix.cc#L492. in rocksdb::env_posix implementation, it will always clear result at first. We will get a core dump when we use rocksdb::RepairDB if we do not clear result. Fixes: http://tracker.ceph.com/issues/20857 Signed-off-by: liuchang0812 --- src/os/bluestore/BlueRocksEnv.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/os/bluestore/BlueRocksEnv.cc b/src/os/bluestore/BlueRocksEnv.cc index 1b1e2e90357..34e8a2fea0b 100644 --- a/src/os/bluestore/BlueRocksEnv.cc +++ b/src/os/bluestore/BlueRocksEnv.cc @@ -407,6 +407,7 @@ rocksdb::Status BlueRocksEnv::GetChildren( const std::string& dir, std::vector* result) { + result->clear(); int r = fs->readdir(dir, result); if (r < 0) return rocksdb::Status::IOError(dir, strerror(ENOENT));// return err_to_status(r); -- 2.39.5