Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common: LibCephFS.GetPoolId failure #5887

Merged
merged 1 commit into from Oct 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/common/ceph_context.cc
Expand Up @@ -399,6 +399,7 @@ CephContext::CephContext(uint32_t module_type_)
_conf(new md_config_t()),
_log(NULL),
_module_type(module_type_),
_crypto_inited(false),
_service_thread(NULL),
_log_obs(NULL),
_admin_socket(NULL),
Expand Down Expand Up @@ -507,7 +508,14 @@ CephContext::~CephContext()

delete _crypto_none;
delete _crypto_aes;
ceph::crypto::shutdown();
if (_crypto_inited)
ceph::crypto::shutdown();
}

void CephContext::init_crypto()
{
ceph::crypto::init(this);
_crypto_inited = true;
}

void CephContext::start_service_thread()
Expand Down
5 changes: 5 additions & 0 deletions src/common/ceph_context.h
Expand Up @@ -77,6 +77,9 @@ class CephContext {
md_config_t *_conf;
ceph::log::Log *_log;

/* init ceph::crypto */
void init_crypto();

/* Start the Ceph Context's service thread */
void start_service_thread();

Expand Down Expand Up @@ -139,6 +142,8 @@ class CephContext {

uint32_t _module_type;

bool _crypto_inited;

/* libcommon service thread.
* SIGHUP wakes this thread, which then reopens logfiles */
friend class CephContextServiceThread;
Expand Down
1 change: 1 addition & 0 deletions src/common/ceph_crypto.cc
Expand Up @@ -76,6 +76,7 @@ void ceph::crypto::init(CephContext *cct)
void ceph::crypto::shutdown()
{
pthread_mutex_lock(&crypto_init_mutex);
assert(crypto_refs > 0);
if (--crypto_refs == 0) {
NSS_ShutdownContext(crypto_context);
crypto_context = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/common/common_init.cc
Expand Up @@ -115,7 +115,7 @@ void complain_about_parse_errors(CephContext *cct,
* same application. */
void common_init_finish(CephContext *cct, int flags)
{
ceph::crypto::init(cct);
cct->init_crypto();

if (!(flags & CINIT_FLAG_NO_DAEMON_ACTIONS))
cct->start_service_thread();
Expand Down