Skip to content

Commit

Permalink
Merge pull request #15033 from rzarzynski/wip-rgw-19831
Browse files Browse the repository at this point in the history
rgw: fix segfault in RevokeThread during its shutdown procedure.

Reviewed-by: Casey Bodley <cbodley@redhat.com>
  • Loading branch information
cbodley committed Jul 26, 2017
2 parents c4ee3a5 + d8606b1 commit 1de6bc2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 7 additions & 2 deletions src/common/dout.h
Expand Up @@ -16,6 +16,8 @@
#ifndef CEPH_DOUT_H
#define CEPH_DOUT_H

#include <type_traits>

#include "global/global_context.h"
#include "common/config.h"
#include "common/likely.h"
Expand Down Expand Up @@ -50,10 +52,13 @@ class DoutPrefixProvider {
if (0) { \
char __array[((v >= -1) && (v <= 200)) ? 0 : -1] __attribute__((unused)); \
} \
static size_t _log_exp_length=80; \
static size_t _log_exp_length = 80; \
ceph::logging::Entry *_dout_e = cct->_log->create_entry(v, sub, &_log_exp_length); \
ostream _dout_os(&_dout_e->m_streambuf); \
CephContext *_dout_cct = cct; \
static_assert(std::is_convertible<decltype(&*cct), \
CephContext* >::value, \
"provided cct must be compatible with CephContext*"); \
auto _dout_cct = cct; \
std::ostream* _dout = &_dout_os;

#define lsubdout(cct, sub, v) dout_impl(cct, ceph_subsys_##sub, v) dout_prefix
Expand Down
6 changes: 4 additions & 2 deletions src/rgw/rgw_keystone.h
Expand Up @@ -12,6 +12,7 @@
#include "rgw_common.h"
#include "rgw_http_client.h"
#include "common/Cond.h"
#include "global/global_init.h"

#include <atomic>

Expand Down Expand Up @@ -224,7 +225,7 @@ class TokenCache {
friend class TokenCache;
typedef RGWPostHTTPData RGWGetRevokedTokens;

CephContext * const cct;
CephContext* const cct;
TokenCache* const cache;
const rgw::keystone::Config& config;

Expand All @@ -239,12 +240,13 @@ class TokenCache {
config(config),
lock("rgw::keystone::TokenCache::RevokeThread") {
}

void *entry() override;
void stop();
int check_revoked();
} revocator;

CephContext * const cct;
const boost::intrusive_ptr<CephContext> cct;

std::string admin_token_id;
std::string barbican_token_id;
Expand Down

0 comments on commit 1de6bc2

Please sign in to comment.