From: Chang Liu Date: Sat, 7 Oct 2017 08:46:46 +0000 (+0800) Subject: os/bluestore: do not core dump when we try to open kvstore twice X-Git-Tag: v13.0.1~623^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F18161%2Fhead;p=ceph.git os/bluestore: do not core dump when we try to open kvstore twice Signed-off-by: Chang Liu --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 8c41e88f5ec4..5d033e7395b2 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -2206,7 +2206,7 @@ int BlueFS::lock_file(const string& dirname, const string& filename, file = q->second.get(); if (file->locked) { dout(10) << __func__ << " already locked" << dendl; - return -EBUSY; + return -ENOLCK; } } file->locked = true; diff --git a/src/os/bluestore/BlueRocksEnv.cc b/src/os/bluestore/BlueRocksEnv.cc index a78f2f1e9e02..bf67b982fcdf 100644 --- a/src/os/bluestore/BlueRocksEnv.cc +++ b/src/os/bluestore/BlueRocksEnv.cc @@ -5,6 +5,7 @@ #include "BlueFS.h" #include "include/stringify.h" #include "kv/RocksDBStore.h" +#include "string.h" rocksdb::Status err_to_status(int r) { @@ -18,6 +19,8 @@ rocksdb::Status err_to_status(int r) case -EIO: case -EEXIST: return rocksdb::Status::IOError(rocksdb::Status::kNone); + case -ENOLCK: + return rocksdb::Status::IOError(strerror(r)); default: // FIXME :( assert(0 == "unrecognized error code");