20 changes: 10 additions & 10 deletions src/osd/OSDMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ class OSDMap {
mempool::osdmap::map<int32_t,uuid_d> new_uuid;
mempool::osdmap::map<int32_t,osd_xinfo_t> new_xinfo;

mempool::osdmap::map<entity_addr_t,utime_t> new_blacklist;
mempool::osdmap::vector<entity_addr_t> old_blacklist;
mempool::osdmap::map<entity_addr_t,utime_t> new_blocklist;
mempool::osdmap::vector<entity_addr_t> old_blocklist;
mempool::osdmap::map<int32_t, entity_addrvec_t> new_hb_back_up;
mempool::osdmap::map<int32_t, entity_addrvec_t> new_hb_front_up;

Expand Down Expand Up @@ -576,7 +576,7 @@ class OSDMap {
std::shared_ptr< mempool::osdmap::vector<uuid_d> > osd_uuid;
mempool::osdmap::vector<osd_xinfo_t> osd_xinfo;

mempool::osdmap::unordered_map<entity_addr_t,utime_t> blacklist;
mempool::osdmap::unordered_map<entity_addr_t,utime_t> blocklist;

/// queue of snaps to remove
mempool::osdmap::map<int64_t, snap_interval_set_t> removed_snaps_queue;
Expand All @@ -589,7 +589,7 @@ class OSDMap {

epoch_t cluster_snapshot_epoch;
std::string cluster_snapshot;
bool new_blacklist_entries;
bool new_blocklist_entries;

float full_ratio = 0, backfillfull_ratio = 0, nearfull_ratio = 0;

Expand Down Expand Up @@ -629,7 +629,7 @@ class OSDMap {
primary_temp(std::make_shared<mempool::osdmap::map<pg_t,int32_t>>()),
osd_uuid(std::make_shared<mempool::osdmap::vector<uuid_d>>()),
cluster_snapshot_epoch(0),
new_blacklist_entries(false),
new_blocklist_entries(false),
cached_up_osd_features(0),
crc_defined(false), crc(0),
crush(std::make_shared<CrushWrapper>()) {
Expand Down Expand Up @@ -680,10 +680,10 @@ class OSDMap {
const utime_t& get_created() const { return created; }
const utime_t& get_modified() const { return modified; }

bool is_blacklisted(const entity_addr_t& a) const;
bool is_blacklisted(const entity_addrvec_t& a) const;
void get_blacklist(std::list<std::pair<entity_addr_t,utime_t > > *bl) const;
void get_blacklist(std::set<entity_addr_t> *bl) const;
bool is_blocklisted(const entity_addr_t& a) const;
bool is_blocklisted(const entity_addrvec_t& a) const;
void get_blocklist(std::list<std::pair<entity_addr_t,utime_t > > *bl) const;
void get_blocklist(std::set<entity_addr_t> *bl) const;

std::string get_cluster_snapshot() const {
if (cluster_snapshot_epoch == epoch)
Expand Down Expand Up @@ -1520,7 +1520,7 @@ class OSDMap {
void dump_osd(int id, ceph::Formatter *f) const;
void dump_osds(ceph::Formatter *f) const;
static void generate_test_instances(std::list<OSDMap*>& o);
bool check_new_blacklist_entries() const { return new_blacklist_entries; }
bool check_new_blocklist_entries() const { return new_blocklist_entries; }

void check_health(CephContext *cct, health_check_map_t *checks) const;

Expand Down
4 changes: 2 additions & 2 deletions src/osd/PeeringState.cc
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ void PeeringState::activate_map(PeeringCtx &rctx)
}
write_if_dirty(rctx.transaction);

if (get_osdmap()->check_new_blacklist_entries()) {
pl->check_blacklisted_watchers();
if (get_osdmap()->check_new_blocklist_entries()) {
pl->check_blocklisted_watchers();
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/osd/PeeringState.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ class PeeringState : public MissingLoc::MappingInfo {

/// Notification to check outstanding operation targets
virtual void check_recovery_sources(const OSDMapRef& newmap) = 0;
/// Notification to check outstanding blacklist
virtual void check_blacklisted_watchers() = 0;
/// Notification to check outstanding blocklist
virtual void check_blocklisted_watchers() = 0;
/// Notification to clear state associated with primary
virtual void clear_primary_state() = 0;

Expand Down
26 changes: 13 additions & 13 deletions src/osd/PrimaryLogPG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1945,10 +1945,10 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
return;
}

// blacklisted?
if (get_osdmap()->is_blacklisted(m->get_source_addr())) {
dout(10) << "do_op " << m->get_source_addr() << " is blacklisted" << dendl;
osd->reply_op_error(op, -EBLACKLISTED);
// blocklisted?
if (get_osdmap()->is_blocklisted(m->get_source_addr())) {
dout(10) << "do_op " << m->get_source_addr() << " is blocklisted" << dendl;
osd->reply_op_error(op, -EBLOCKLISTED);
return;
}

Expand Down Expand Up @@ -10914,17 +10914,17 @@ void PrimaryLogPG::get_obc_watchers(ObjectContextRef obc, list<obj_watch_item_t>
}
}

void PrimaryLogPG::check_blacklisted_watchers()
void PrimaryLogPG::check_blocklisted_watchers()
{
dout(20) << "PrimaryLogPG::check_blacklisted_watchers for pg " << get_pgid() << dendl;
dout(20) << "PrimaryLogPG::check_blocklisted_watchers for pg " << get_pgid() << dendl;
pair<hobject_t, ObjectContextRef> i;
while (object_contexts.get_next(i.first, &i))
check_blacklisted_obc_watchers(i.second);
check_blocklisted_obc_watchers(i.second);
}

void PrimaryLogPG::check_blacklisted_obc_watchers(ObjectContextRef obc)
void PrimaryLogPG::check_blocklisted_obc_watchers(ObjectContextRef obc)
{
dout(20) << "PrimaryLogPG::check_blacklisted_obc_watchers for obc " << obc->obs.oi.soid << dendl;
dout(20) << "PrimaryLogPG::check_blocklisted_obc_watchers for obc " << obc->obs.oi.soid << dendl;
for (map<pair<uint64_t, entity_name_t>, WatchRef>::iterator k =
obc->watchers.begin();
k != obc->watchers.end();
Expand All @@ -10934,8 +10934,8 @@ void PrimaryLogPG::check_blacklisted_obc_watchers(ObjectContextRef obc)
dout(30) << "watch: Found " << j->second->get_entity() << " cookie " << j->second->get_cookie() << dendl;
entity_addr_t ea = j->second->get_peer_addr();
dout(30) << "watch: Check entity_addr_t " << ea << dendl;
if (get_osdmap()->is_blacklisted(ea)) {
dout(10) << "watch: Found blacklisted watcher for " << ea << dendl;
if (get_osdmap()->is_blocklisted(ea)) {
dout(10) << "watch: Found blocklisted watcher for " << ea << dendl;
ceph_assert(j->second->get_pg() == this);
j->second->unregister_cb();
handle_watch_timeout(j->second);
Expand Down Expand Up @@ -10975,8 +10975,8 @@ void PrimaryLogPG::populate_obc_watchers(ObjectContextRef obc)
make_pair(p->first.first, p->first.second),
watch));
}
// Look for watchers from blacklisted clients and drop
check_blacklisted_obc_watchers(obc);
// Look for watchers from blocklisted clients and drop
check_blocklisted_obc_watchers(obc);
}

void PrimaryLogPG::handle_watch_timeout(WatchRef watch)
Expand Down
4 changes: 2 additions & 2 deletions src/osd/PrimaryLogPG.h
Original file line number Diff line number Diff line change
Expand Up @@ -1053,8 +1053,8 @@ class PrimaryLogPG : public PG, public PGBackend::Listener {
std::map<hobject_t, std::map<client_t, ceph_tid_t>> debug_op_order;

void populate_obc_watchers(ObjectContextRef obc);
void check_blacklisted_obc_watchers(ObjectContextRef obc);
void check_blacklisted_watchers() override;
void check_blocklisted_obc_watchers(ObjectContextRef obc);
void check_blocklisted_watchers() override;
void get_watchers(std::list<obj_watch_item_t> *ls) override;
void get_obc_watchers(ObjectContextRef obc, std::list<obj_watch_item_t> &pg_watchers);
public:
Expand Down
12 changes: 6 additions & 6 deletions src/osd/error_code.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ const char* osd_error_category::message(int ev, char* buf,
switch (static_cast<osd_errc>(ev)) {
case osd_errc::old_snapc:
return "ORDERSNAP flag set; writer has old snapc";
case osd_errc::blacklisted:
return "Blacklisted";
case osd_errc::blocklisted:
return "Blocklisted";
}

if (len) {
Expand All @@ -70,16 +70,16 @@ std::string osd_error_category::message(int ev) const {
switch (static_cast<osd_errc>(ev)) {
case osd_errc::old_snapc:
return "ORDERSNAP flag set; writer has old snapc";
case osd_errc::blacklisted:
return "Blacklisted";
case osd_errc::blocklisted:
return "Blocklisted";
}

return cpp_strerror(ev);
}

boost::system::error_condition osd_error_category::default_error_condition(int ev) const noexcept {
if (ev == static_cast<int>(osd_errc::old_snapc) ||
ev == static_cast<int>(osd_errc::blacklisted))
ev == static_cast<int>(osd_errc::blocklisted))
return { ev, *this };
else
return { ev, boost::system::generic_category() };
Expand All @@ -89,7 +89,7 @@ bool osd_error_category::equivalent(int ev, const boost::system::error_condition
switch (static_cast<osd_errc>(ev)) {
case osd_errc::old_snapc:
return c == boost::system::errc::invalid_argument;
case osd_errc::blacklisted:
case osd_errc::blocklisted:
return c == boost::system::errc::operation_not_permitted;
}
return default_error_condition(ev) == c;
Expand Down
2 changes: 1 addition & 1 deletion src/osd/error_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const boost::system::error_category& osd_category() noexcept;

enum class osd_errc {
old_snapc = 85, /* ORDERSNAP flag set; writer has old snapc*/
blacklisted = 108 /* blacklisted */
blocklisted = 108 /* blocklisted */
};

namespace boost::system {
Expand Down
4 changes: 2 additions & 2 deletions src/osdc/Journaler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ void Journaler::_finish_reread_head_and_probe(int r, C_OnFinisher *onfinish)
}

// Let the caller know that the operation has failed or was intentionally
// failed since the caller has been blacklisted.
if (r == -EBLACKLISTED) {
// failed since the caller has been blocklisted.
if (r == -EBLOCKLISTED) {
onfinish->complete(r);
return;
}
Expand Down
51 changes: 27 additions & 24 deletions src/osdc/Objecter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ void Objecter::handle_osd_map(MOSDMap *m)
OSDMap::Incremental inc(m->incremental_maps[e]);
osdmap->apply_incremental(inc);

emit_blacklist_events(inc);
emit_blocklist_events(inc);

logger->inc(l_osdc_map_inc);
}
Expand All @@ -1188,7 +1188,7 @@ void Objecter::handle_osd_map(MOSDMap *m)
auto new_osdmap = std::make_unique<OSDMap>();
new_osdmap->decode(m->maps[e]);

emit_blacklist_events(*osdmap, *new_osdmap);
emit_blocklist_events(*osdmap, *new_osdmap);
osdmap = std::move(new_osdmap);

logger->inc(l_osdc_map_full);
Expand Down Expand Up @@ -1360,56 +1360,56 @@ void Objecter::handle_osd_map(MOSDMap *m)
}
}

void Objecter::enable_blacklist_events()
void Objecter::enable_blocklist_events()
{
unique_lock wl(rwlock);

blacklist_events_enabled = true;
blocklist_events_enabled = true;
}

void Objecter::consume_blacklist_events(std::set<entity_addr_t> *events)
void Objecter::consume_blocklist_events(std::set<entity_addr_t> *events)
{
unique_lock wl(rwlock);

if (events->empty()) {
events->swap(blacklist_events);
events->swap(blocklist_events);
} else {
for (const auto &i : blacklist_events) {
for (const auto &i : blocklist_events) {
events->insert(i);
}
blacklist_events.clear();
blocklist_events.clear();
}
}

void Objecter::emit_blacklist_events(const OSDMap::Incremental &inc)
void Objecter::emit_blocklist_events(const OSDMap::Incremental &inc)
{
if (!blacklist_events_enabled) {
if (!blocklist_events_enabled) {
return;
}

for (const auto &i : inc.new_blacklist) {
blacklist_events.insert(i.first);
for (const auto &i : inc.new_blocklist) {
blocklist_events.insert(i.first);
}
}

void Objecter::emit_blacklist_events(const OSDMap &old_osd_map,
void Objecter::emit_blocklist_events(const OSDMap &old_osd_map,
const OSDMap &new_osd_map)
{
if (!blacklist_events_enabled) {
if (!blocklist_events_enabled) {
return;
}

std::set<entity_addr_t> old_set;
std::set<entity_addr_t> new_set;

old_osd_map.get_blacklist(&old_set);
new_osd_map.get_blacklist(&new_set);
old_osd_map.get_blocklist(&old_set);
new_osd_map.get_blocklist(&new_set);

std::set<entity_addr_t> delta_set;
std::set_difference(
new_set.begin(), new_set.end(), old_set.begin(), old_set.end(),
std::inserter(delta_set, delta_set.begin()));
blacklist_events.insert(delta_set.begin(), delta_set.end());
blocklist_events.insert(delta_set.begin(), delta_set.end());
}

// op pool check
Expand Down Expand Up @@ -4619,24 +4619,27 @@ int Objecter::RequestStateHook::call(std::string_view command,
return 0;
}

void Objecter::blacklist_self(bool set)
void Objecter::blocklist_self(bool set)
{
ldout(cct, 10) << "blacklist_self " << (set ? "add" : "rm") << dendl;
ldout(cct, 10) << "blocklist_self " << (set ? "add" : "rm") << dendl;

vector<string> cmd;
cmd.push_back("{\"prefix\":\"osd blacklist\", ");
cmd.push_back("{\"prefix\":\"osd blocklist\", ");
if (set)
cmd.push_back("\"blacklistop\":\"add\",");
cmd.push_back("\"blocklistop\":\"add\",");
else
cmd.push_back("\"blacklistop\":\"rm\",");
cmd.push_back("\"blocklistop\":\"rm\",");
stringstream ss;
// this is somewhat imprecise in that we are blacklisting our first addr only
// this is somewhat imprecise in that we are blocklisting our first addr only
ss << messenger->get_myaddrs().front().get_legacy_str();
cmd.push_back("\"addr\":\"" + ss.str() + "\"");

auto m = new MMonCommand(monc->get_fsid());
m->cmd = cmd;

// NOTE: no fallback to legacy blacklist command implemented here
// since this is only used for test code.

monc->send_mon_message(m);
}

Expand Down Expand Up @@ -4921,7 +4924,7 @@ Objecter::~Objecter()
* sending any more operations to OSDs. Use this
* when it is known that the client can't trust
* anything from before this epoch (e.g. due to
* client blacklist at this epoch).
* client blocklist at this epoch).
*/
void Objecter::set_epoch_barrier(epoch_t epoch)
{
Expand Down
22 changes: 11 additions & 11 deletions src/osdc/Objecter.h
Original file line number Diff line number Diff line change
Expand Up @@ -1651,10 +1651,10 @@ class Objecter : public md_config_obs_t, public Dispatcher {
bool honor_pool_full = true;
bool pool_full_try = false;

// If this is true, accumulate a set of blacklisted entities
// to be drained by consume_blacklist_events.
bool blacklist_events_enabled = false;
std::set<entity_addr_t> blacklist_events;
// If this is true, accumulate a set of blocklisted entities
// to be drained by consume_blocklist_events.
bool blocklist_events_enabled = false;
std::set<entity_addr_t> blocklist_events;
struct pg_mapping_t {
epoch_t epoch = 0;
std::vector<int> up;
Expand Down Expand Up @@ -1716,7 +1716,7 @@ class Objecter : public md_config_obs_t, public Dispatcher {
public:
void maybe_request_map();

void enable_blacklist_events();
void enable_blocklist_events();
private:

void _maybe_request_map();
Expand Down Expand Up @@ -2675,15 +2675,15 @@ class Objecter : public md_config_obs_t, public Dispatcher {


/**
* Get std::list of entities blacklisted since this was last called,
* Get std::list of entities blocklisted since this was last called,
* and reset the std::list.
*
* Uses a std::set because typical use case is to compare some
* other std::list of clients to see which overlap with the blacklisted
* other std::list of clients to see which overlap with the blocklisted
* addrs.
*
*/
void consume_blacklist_events(std::set<entity_addr_t> *events);
void consume_blocklist_events(std::set<entity_addr_t> *events);

int pool_snap_by_name(int64_t poolid,
const char *snap_name,
Expand All @@ -2693,8 +2693,8 @@ class Objecter : public md_config_obs_t, public Dispatcher {
int pool_snap_list(int64_t poolid, std::vector<uint64_t> *snaps);
private:

void emit_blacklist_events(const OSDMap::Incremental &inc);
void emit_blacklist_events(const OSDMap &old_osd_map,
void emit_blocklist_events(const OSDMap::Incremental &inc);
void emit_blocklist_events(const OSDMap &old_osd_map,
const OSDMap &new_osd_map);

// low-level
Expand Down Expand Up @@ -3888,7 +3888,7 @@ class Objecter : public md_config_obs_t, public Dispatcher {
void ms_handle_remote_reset(Connection *con) override;
bool ms_handle_refused(Connection *con) override;

void blacklist_self(bool set);
void blocklist_self(bool set);

private:
epoch_t epoch_barrier = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/pybind/mgr/cephadm/services/iscsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def create(self, daemon_spec: CephadmDaemonSpec[IscsiServiceSpec]) -> str:
'prefix': 'auth get-or-create',
'entity': utils.name_to_auth_entity('iscsi', igw_id),
'caps': ['mon', 'profile rbd, '
'allow command "osd blacklist", '
'allow command "osd blocklist", '
'allow command "config-key get" with "key" prefix "iscsi/"',
'osd', 'allow rwx'],
})
Expand Down
12 changes: 6 additions & 6 deletions src/pybind/rados/rados.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ cdef extern from "rados/librados.h" nogil:

int rados_cluster_stat(rados_t cluster, rados_cluster_stat_t *result)
int rados_cluster_fsid(rados_t cluster, char *buf, size_t len)
int rados_blacklist_add(rados_t cluster, char *client_address, uint32_t expire_seconds)
int rados_blocklist_add(rados_t cluster, char *client_address, uint32_t expire_seconds)
int rados_getaddrs(rados_t cluster, char** addrs)
int rados_application_enable(rados_ioctx_t io, const char *app_name,
int force)
Expand Down Expand Up @@ -1575,13 +1575,13 @@ Rados object in state %s." % self.state)
ret = rados_wait_for_latest_osdmap(self.cluster)
return ret

def blacklist_add(self, client_address, expire_seconds=0):
def blocklist_add(self, client_address, expire_seconds=0):
"""
Blacklist a client from the OSDs
Blocklist a client from the OSDs

:param client_address: client address
:type client_address: str
:param expire_seconds: number of seconds to blacklist
:param expire_seconds: number of seconds to blocklist
:type expire_seconds: int

:raises: :class:`Error`
Expand All @@ -1593,9 +1593,9 @@ Rados object in state %s." % self.state)
char *_client_address = client_address

with nogil:
ret = rados_blacklist_add(self.cluster, _client_address, _expire_seconds)
ret = rados_blocklist_add(self.cluster, _client_address, _expire_seconds)
if ret < 0:
raise make_ex(ret, "error blacklisting client '%s'" % client_address)
raise make_ex(ret, "error blocklisting client '%s'" % client_address)

def monitor_log(self, level, callback, arg):
if level not in MONITOR_LEVELS:
Expand Down
4 changes: 2 additions & 2 deletions src/rgw/rgw_op.h
Original file line number Diff line number Diff line change
Expand Up @@ -2027,7 +2027,7 @@ static inline int rgw_get_request_metadata(CephContext* const cct,
std::map<std::string, ceph::bufferlist>& attrs,
const bool allow_empty_attrs = true)
{
static const std::set<std::string> blacklisted_headers = {
static const std::set<std::string> blocklisted_headers = {
"x-amz-server-side-encryption-customer-algorithm",
"x-amz-server-side-encryption-customer-key",
"x-amz-server-side-encryption-customer-key-md5",
Expand All @@ -2039,7 +2039,7 @@ static inline int rgw_get_request_metadata(CephContext* const cct,
const std::string& name = kv.first;
std::string& xattr = kv.second;

if (blacklisted_headers.count(name) == 1) {
if (blocklisted_headers.count(name) == 1) {
lsubdout(cct, rgw, 10) << "skipping x>> " << name << dendl;
continue;
} else if (allow_empty_attrs || !xattr.empty()) {
Expand Down
6 changes: 3 additions & 3 deletions src/test/librados_test_stub/LibradosTestStub.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1043,10 +1043,10 @@ int Rados::aio_watch_flush(AioCompletion* c) {
return impl->aio_watch_flush(c->pc);
}

int Rados::blacklist_add(const std::string& client_address,
int Rados::blocklist_add(const std::string& client_address,
uint32_t expire_seconds) {
TestRadosClient *impl = reinterpret_cast<TestRadosClient*>(client);
return impl->blacklist_add(client_address, expire_seconds);
return impl->blocklist_add(client_address, expire_seconds);
}

config_t Rados::cct() {
Expand Down Expand Up @@ -1218,7 +1218,7 @@ void Rados::shutdown() {
client = NULL;
}

void Rados::test_blacklist_self(bool set) {
void Rados::test_blocklist_self(bool set) {
}

int Rados::wait_for_latest_osdmap() {
Expand Down
8 changes: 4 additions & 4 deletions src/test/librados_test_stub/MockTestMemRadosClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ class MockTestMemRadosClient : public TestMemRadosClient {
get_mem_cluster()->get_pool(pool_name));
}

MOCK_METHOD2(blacklist_add, int(const std::string& client_address,
MOCK_METHOD2(blocklist_add, int(const std::string& client_address,
uint32_t expire_seconds));
int do_blacklist_add(const std::string& client_address,
int do_blocklist_add(const std::string& client_address,
uint32_t expire_seconds) {
return TestMemRadosClient::blacklist_add(client_address, expire_seconds);
return TestMemRadosClient::blocklist_add(client_address, expire_seconds);
}

MOCK_METHOD1(get_min_compatible_osd, int(int8_t*));
Expand Down Expand Up @@ -88,7 +88,7 @@ class MockTestMemRadosClient : public TestMemRadosClient {

ON_CALL(*this, connect()).WillByDefault(Invoke(this, &MockTestMemRadosClient::do_connect));
ON_CALL(*this, create_ioctx(_, _)).WillByDefault(Invoke(this, &MockTestMemRadosClient::do_create_ioctx));
ON_CALL(*this, blacklist_add(_, _)).WillByDefault(Invoke(this, &MockTestMemRadosClient::do_blacklist_add));
ON_CALL(*this, blocklist_add(_, _)).WillByDefault(Invoke(this, &MockTestMemRadosClient::do_blocklist_add));
ON_CALL(*this, get_min_compatible_osd(_)).WillByDefault(Invoke(this, &MockTestMemRadosClient::do_get_min_compatible_osd));
ON_CALL(*this, get_min_compatible_client(_, _)).WillByDefault(Invoke(this, &MockTestMemRadosClient::do_get_min_compatible_client));
ON_CALL(*this, service_daemon_register(_, _, _)).WillByDefault(Invoke(this, &MockTestMemRadosClient::do_service_daemon_register));
Expand Down
40 changes: 20 additions & 20 deletions src/test/librados_test_stub/TestIoCtxImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ int TestIoCtxImpl::aio_watch(const std::string& o, AioCompletionImpl *c,
m_pending_ops++;
c->get();
C_AioNotify *ctx = new C_AioNotify(this, c);
if (m_client->is_blacklisted()) {
m_client->get_aio_finisher()->queue(ctx, -EBLACKLISTED);
if (m_client->is_blocklisted()) {
m_client->get_aio_finisher()->queue(ctx, -EBLOCKLISTED);
} else {
m_client->get_watch_notify()->aio_watch(m_client, m_pool_id,
get_namespace(), o,
Expand All @@ -149,8 +149,8 @@ int TestIoCtxImpl::aio_unwatch(uint64_t handle, AioCompletionImpl *c) {
m_pending_ops++;
c->get();
C_AioNotify *ctx = new C_AioNotify(this, c);
if (m_client->is_blacklisted()) {
m_client->get_aio_finisher()->queue(ctx, -EBLACKLISTED);
if (m_client->is_blocklisted()) {
m_client->get_aio_finisher()->queue(ctx, -EBLOCKLISTED);
} else {
m_client->get_watch_notify()->aio_unwatch(m_client, handle, ctx);
}
Expand All @@ -161,8 +161,8 @@ int TestIoCtxImpl::exec(const std::string& oid, TestClassHandler *handler,
const char *cls, const char *method,
bufferlist& inbl, bufferlist* outbl,
uint64_t snap_id, const SnapContext &snapc) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

cls_method_cxx_call_t call = handler->get_method(cls, method);
Expand All @@ -177,8 +177,8 @@ int TestIoCtxImpl::exec(const std::string& oid, TestClassHandler *handler,

int TestIoCtxImpl::list_watchers(const std::string& o,
std::list<obj_watch_t> *out_watchers) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

return m_client->get_watch_notify()->list_watchers(m_pool_id, get_namespace(),
Expand All @@ -187,8 +187,8 @@ int TestIoCtxImpl::list_watchers(const std::string& o,

int TestIoCtxImpl::notify(const std::string& o, bufferlist& bl,
uint64_t timeout_ms, bufferlist *pbl) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

return m_client->get_watch_notify()->notify(m_client, m_pool_id,
Expand Down Expand Up @@ -273,8 +273,8 @@ void TestIoCtxImpl::set_snap_read(snap_t seq) {
}

int TestIoCtxImpl::tmap_update(const std::string& oid, bufferlist& cmdbl) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

// TODO: protect against concurrent tmap updates
Expand Down Expand Up @@ -330,17 +330,17 @@ int TestIoCtxImpl::tmap_update(const std::string& oid, bufferlist& cmdbl) {
}

int TestIoCtxImpl::unwatch(uint64_t handle) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

return m_client->get_watch_notify()->unwatch(m_client, handle);
}

int TestIoCtxImpl::watch(const std::string& o, uint64_t *handle,
librados::WatchCtx *ctx, librados::WatchCtx2 *ctx2) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

return m_client->get_watch_notify()->watch(m_client, m_pool_id,
Expand All @@ -351,8 +351,8 @@ int TestIoCtxImpl::watch(const std::string& o, uint64_t *handle,

int TestIoCtxImpl::execute_operation(const std::string& oid,
const Operation &operation) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

TestRadosClient::Transaction transaction(m_client, get_namespace(), oid);
Expand All @@ -364,8 +364,8 @@ int TestIoCtxImpl::execute_aio_operations(const std::string& oid,
bufferlist *pbl, uint64_t snap_id,
const SnapContext &snapc) {
int ret = 0;
if (m_client->is_blacklisted()) {
ret = -EBLACKLISTED;
if (m_client->is_blocklisted()) {
ret = -EBLOCKLISTED;
} else {
TestRadosClient::Transaction transaction(m_client, get_namespace(), oid);
for (ObjectOperations::iterator it = ops->ops.begin();
Expand Down
12 changes: 6 additions & 6 deletions src/test/librados_test_stub/TestMemCluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,19 @@ void TestMemCluster::allocate_client(uint32_t *nonce, uint64_t *global_id) {

void TestMemCluster::deallocate_client(uint32_t nonce) {
std::lock_guard locker{m_lock};
m_blacklist.erase(nonce);
m_blocklist.erase(nonce);
}

bool TestMemCluster::is_blacklisted(uint32_t nonce) const {
bool TestMemCluster::is_blocklisted(uint32_t nonce) const {
std::lock_guard locker{m_lock};
return (m_blacklist.find(nonce) != m_blacklist.end());
return (m_blocklist.find(nonce) != m_blocklist.end());
}

void TestMemCluster::blacklist(uint32_t nonce) {
m_watch_notify.blacklist(nonce);
void TestMemCluster::blocklist(uint32_t nonce) {
m_watch_notify.blocklist(nonce);

std::lock_guard locker{m_lock};
m_blacklist.insert(nonce);
m_blocklist.insert(nonce);
}

void TestMemCluster::transaction_start(const ObjectLocator& locator) {
Expand Down
8 changes: 4 additions & 4 deletions src/test/librados_test_stub/TestMemCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ class TestMemCluster : public TestCluster {
void allocate_client(uint32_t *nonce, uint64_t *global_id);
void deallocate_client(uint32_t nonce);

bool is_blacklisted(uint32_t nonce) const;
void blacklist(uint32_t nonce);
bool is_blocklisted(uint32_t nonce) const;
void blocklist(uint32_t nonce);

void transaction_start(const ObjectLocator& locator);
void transaction_finish(const ObjectLocator& locator);

private:

typedef std::map<std::string, Pool*> Pools;
typedef std::set<uint32_t> Blacklist;
typedef std::set<uint32_t> Blocklist;

mutable ceph::mutex m_lock =
ceph::make_mutex("TestMemCluster::m_lock");
Expand All @@ -111,7 +111,7 @@ class TestMemCluster : public TestCluster {
uint32_t m_next_nonce;
uint64_t m_next_global_id = 1234;

Blacklist m_blacklist;
Blocklist m_blocklist;

ceph::condition_variable m_transaction_cond;
std::set<ObjectLocator> m_transactions;
Expand Down
92 changes: 46 additions & 46 deletions src/test/librados_test_stub/TestMemIoCtxImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ int TestMemIoCtxImpl::append(const std::string& oid, const bufferlist &bl,
const SnapContext &snapc) {
if (get_snap_read() != CEPH_NOSNAP) {
return -EROFS;
} else if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
} else if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

TestMemCluster::SharedFile file;
Expand All @@ -87,8 +87,8 @@ int TestMemIoCtxImpl::append(const std::string& oid, const bufferlist &bl,
}

int TestMemIoCtxImpl::assert_exists(const std::string &oid, uint64_t snap_id) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

std::shared_lock l{m_pool->file_lock};
Expand Down Expand Up @@ -123,8 +123,8 @@ int TestMemIoCtxImpl::create(const std::string& oid, bool exclusive,
const SnapContext &snapc) {
if (get_snap_read() != CEPH_NOSNAP) {
return -EROFS;
} else if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
} else if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

std::unique_lock l{m_pool->file_lock};
Expand All @@ -140,8 +140,8 @@ int TestMemIoCtxImpl::create(const std::string& oid, bool exclusive,
}

int TestMemIoCtxImpl::list_snaps(const std::string& oid, snap_set_t *out_snaps) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

out_snaps->seq = 0;
Expand Down Expand Up @@ -218,8 +218,8 @@ int TestMemIoCtxImpl::omap_get_vals2(const std::string& oid,
bool *pmore) {
if (out_vals == NULL) {
return -EINVAL;
} else if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
} else if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

TestMemCluster::SharedFile file;
Expand Down Expand Up @@ -275,8 +275,8 @@ int TestMemIoCtxImpl::omap_rm_keys(const std::string& oid,
const std::set<std::string>& keys) {
if (get_snap_read() != CEPH_NOSNAP) {
return -EROFS;
} else if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
} else if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

TestMemCluster::SharedFile file;
Expand All @@ -300,8 +300,8 @@ int TestMemIoCtxImpl::omap_set(const std::string& oid,
const std::map<std::string, bufferlist> &map) {
if (get_snap_read() != CEPH_NOSNAP) {
return -EROFS;
} else if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
} else if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

TestMemCluster::SharedFile file;
Expand All @@ -326,8 +326,8 @@ int TestMemIoCtxImpl::omap_set(const std::string& oid,

int TestMemIoCtxImpl::read(const std::string& oid, size_t len, uint64_t off,
bufferlist *bl, uint64_t snap_id) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

TestMemCluster::SharedFile file;
Expand Down Expand Up @@ -355,8 +355,8 @@ int TestMemIoCtxImpl::read(const std::string& oid, size_t len, uint64_t off,
int TestMemIoCtxImpl::remove(const std::string& oid, const SnapContext &snapc) {
if (get_snap_read() != CEPH_NOSNAP) {
return -EROFS;
} else if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
} else if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

std::unique_lock l{m_pool->file_lock};
Expand Down Expand Up @@ -393,8 +393,8 @@ int TestMemIoCtxImpl::remove(const std::string& oid, const SnapContext &snapc) {
}

int TestMemIoCtxImpl::selfmanaged_snap_create(uint64_t *snapid) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

std::unique_lock l{m_pool->file_lock};
Expand All @@ -404,8 +404,8 @@ int TestMemIoCtxImpl::selfmanaged_snap_create(uint64_t *snapid) {
}

int TestMemIoCtxImpl::selfmanaged_snap_remove(uint64_t snapid) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

std::unique_lock l{m_pool->file_lock};
Expand All @@ -422,8 +422,8 @@ int TestMemIoCtxImpl::selfmanaged_snap_remove(uint64_t snapid) {

int TestMemIoCtxImpl::selfmanaged_snap_rollback(const std::string& oid,
uint64_t snapid) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

std::unique_lock l{m_pool->file_lock};
Expand Down Expand Up @@ -476,8 +476,8 @@ int TestMemIoCtxImpl::set_alloc_hint(const std::string& oid,
const SnapContext &snapc) {
if (get_snap_read() != CEPH_NOSNAP) {
return -EROFS;
} else if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
} else if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

{
Expand All @@ -492,8 +492,8 @@ int TestMemIoCtxImpl::sparse_read(const std::string& oid, uint64_t off,
uint64_t len,
std::map<uint64_t,uint64_t> *m,
bufferlist *data_bl, uint64_t snap_id) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

// TODO verify correctness
Expand Down Expand Up @@ -525,8 +525,8 @@ int TestMemIoCtxImpl::sparse_read(const std::string& oid, uint64_t off,

int TestMemIoCtxImpl::stat(const std::string& oid, uint64_t *psize,
time_t *pmtime) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

TestMemCluster::SharedFile file;
Expand All @@ -552,8 +552,8 @@ int TestMemIoCtxImpl::truncate(const std::string& oid, uint64_t size,
const SnapContext &snapc) {
if (get_snap_read() != CEPH_NOSNAP) {
return -EROFS;
} else if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
} else if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

TestMemCluster::SharedFile file;
Expand Down Expand Up @@ -590,8 +590,8 @@ int TestMemIoCtxImpl::write(const std::string& oid, bufferlist& bl, size_t len,
uint64_t off, const SnapContext &snapc) {
if (get_snap_read() != CEPH_NOSNAP) {
return -EROFS;
} else if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
} else if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

TestMemCluster::SharedFile file;
Expand All @@ -617,8 +617,8 @@ int TestMemIoCtxImpl::write_full(const std::string& oid, bufferlist& bl,
const SnapContext &snapc) {
if (get_snap_read() != CEPH_NOSNAP) {
return -EROFS;
} else if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
} else if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

TestMemCluster::SharedFile file;
Expand Down Expand Up @@ -649,8 +649,8 @@ int TestMemIoCtxImpl::writesame(const std::string& oid, bufferlist& bl,
const SnapContext &snapc) {
if (get_snap_read() != CEPH_NOSNAP) {
return -EROFS;
} else if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
} else if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

if (len == 0 || (len % bl.length())) {
Expand Down Expand Up @@ -682,8 +682,8 @@ int TestMemIoCtxImpl::writesame(const std::string& oid, bufferlist& bl,

int TestMemIoCtxImpl::cmpext(const std::string& oid, uint64_t off,
bufferlist& cmp_bl, uint64_t snap_id) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

bufferlist read_bl;
Expand All @@ -710,8 +710,8 @@ int TestMemIoCtxImpl::cmpext(const std::string& oid, uint64_t off,

int TestMemIoCtxImpl::xattr_get(const std::string& oid,
std::map<std::string, bufferlist>* attrset) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

TestMemCluster::SharedFile file;
Expand All @@ -727,8 +727,8 @@ int TestMemIoCtxImpl::xattr_get(const std::string& oid,

int TestMemIoCtxImpl::xattr_set(const std::string& oid, const std::string &name,
bufferlist& bl) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

std::unique_lock l{m_pool->file_lock};
Expand All @@ -738,8 +738,8 @@ int TestMemIoCtxImpl::xattr_set(const std::string& oid, const std::string &name,

int TestMemIoCtxImpl::zero(const std::string& oid, uint64_t off, uint64_t len,
const SnapContext &snapc) {
if (m_client->is_blacklisted()) {
return -EBLACKLISTED;
if (m_client->is_blocklisted()) {
return -EBLOCKLISTED;
}

bool truncate_redirect = false;
Expand Down
20 changes: 10 additions & 10 deletions src/test/librados_test_stub/TestMemRadosClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ void TestMemRadosClient::object_list(int64_t pool_id,
}

int TestMemRadosClient::pool_create(const std::string &pool_name) {
if (is_blacklisted()) {
return -EBLACKLISTED;
if (is_blocklisted()) {
return -EBLOCKLISTED;
}
return m_mem_cluster->pool_create(pool_name);
}

int TestMemRadosClient::pool_delete(const std::string &pool_name) {
if (is_blacklisted()) {
return -EBLACKLISTED;
if (is_blocklisted()) {
return -EBLOCKLISTED;
}
return m_mem_cluster->pool_delete(pool_name);
}
Expand Down Expand Up @@ -78,14 +78,14 @@ int TestMemRadosClient::watch_flush() {
return 0;
}

bool TestMemRadosClient::is_blacklisted() const {
return m_mem_cluster->is_blacklisted(m_nonce);
bool TestMemRadosClient::is_blocklisted() const {
return m_mem_cluster->is_blocklisted(m_nonce);
}

int TestMemRadosClient::blacklist_add(const std::string& client_address,
int TestMemRadosClient::blocklist_add(const std::string& client_address,
uint32_t expire_seconds) {
if (is_blacklisted()) {
return -EBLACKLISTED;
if (is_blocklisted()) {
return -EBLOCKLISTED;
}

// extract the nonce to use as a unique key to the client
Expand All @@ -101,7 +101,7 @@ int TestMemRadosClient::blacklist_add(const std::string& client_address,
return -EINVAL;
}

m_mem_cluster->blacklist(nonce);
m_mem_cluster->blocklist(nonce);
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/librados_test_stub/TestMemRadosClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class TestMemRadosClient : public TestRadosClient {

int watch_flush() override;

bool is_blacklisted() const override;
int blacklist_add(const std::string& client_address,
bool is_blocklisted() const override;
int blocklist_add(const std::string& client_address,
uint32_t expire_seconds) override;
protected:
TestMemCluster *get_mem_cluster() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/librados_test_stub/TestRadosClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class TestRadosClient : public md_config_obs_t {
virtual int aio_watch_flush(AioCompletionImpl *c);
virtual int watch_flush() = 0;

virtual bool is_blacklisted() const = 0;
virtual int blacklist_add(const std::string& client_address,
virtual bool is_blocklisted() const = 0;
virtual int blocklist_add(const std::string& client_address,
uint32_t expire_seconds) = 0;

virtual int wait_for_latest_osd_map() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/librados_test_stub/TestWatchNotify.cc
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ void TestWatchNotify::finish_notify(TestRadosClient *rados_client,
maybe_remove_watcher(watcher);
}

void TestWatchNotify::blacklist(uint32_t nonce) {
void TestWatchNotify::blocklist(uint32_t nonce) {
std::lock_guard locker{m_lock};

for (auto file_it = m_file_watchers.begin();
Expand Down
2 changes: 1 addition & 1 deletion src/test/librados_test_stub/TestWatchNotify.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class TestWatchNotify : boost::noncopyable {
librados::WatchCtx2 *ctx2);
int unwatch(TestRadosClient *rados_client, uint64_t handle);

void blacklist(uint32_t nonce);
void blocklist(uint32_t nonce);

private:
typedef std::tuple<int64_t, std::string, std::string> PoolFile;
Expand Down
12 changes: 6 additions & 6 deletions src/test/librbd/managed_lock/test_mock_AcquireRequest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ struct BreakRequest<librbd::MockImageCtx> {
static BreakRequest* create(librados::IoCtx& ioctx,
AsioEngine& asio_engine,
const std::string& oid, const Locker &locker,
bool exclusive, bool blacklist_locker,
uint32_t blacklist_expire_seconds,
bool exclusive, bool blocklist_locker,
uint32_t blocklist_expire_seconds,
bool force_break_lock, Context *on_finish) {
CephContext *cct = reinterpret_cast<CephContext *>(ioctx.cct());
EXPECT_EQ(cct->_conf.get_val<bool>("rbd_blacklist_on_break_lock"),
blacklist_locker);
EXPECT_EQ(cct->_conf.get_val<uint64_t>("rbd_blacklist_expire_seconds"),
blacklist_expire_seconds);
EXPECT_EQ(cct->_conf.get_val<bool>("rbd_blocklist_on_break_lock"),
blocklist_locker);
EXPECT_EQ(cct->_conf.get_val<uint64_t>("rbd_blocklist_expire_seconds"),
blocklist_expire_seconds);
EXPECT_FALSE(force_break_lock);
ceph_assert(s_instance != nullptr);
s_instance->on_finish = on_finish;
Expand Down
20 changes: 10 additions & 10 deletions src/test/librbd/managed_lock/test_mock_BreakRequest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ class TestMockManagedLockBreakRequest : public TestMockFixture {
}


void expect_blacklist_add(MockTestImageCtx &mock_image_ctx, int r) {
void expect_blocklist_add(MockTestImageCtx &mock_image_ctx, int r) {
auto& mock_rados_client = librados::get_mock_rados_client(
mock_image_ctx.rados_api);
EXPECT_CALL(mock_rados_client, mon_command(IsBlacklistCommand(), _, _, _))
EXPECT_CALL(mock_rados_client, mon_command(IsBlocklistCommand(), _, _, _))
.WillOnce(Return(r));
}

Expand Down Expand Up @@ -154,7 +154,7 @@ TEST_F(TestMockManagedLockBreakRequest, DeadLockOwner) {
{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123},
0);

expect_blacklist_add(mock_image_ctx, 0);
expect_blocklist_add(mock_image_ctx, 0);
expect_wait_for_latest_osd_map(mock_image_ctx, 0);
expect_break_lock(mock_image_ctx, 0);

Expand Down Expand Up @@ -184,7 +184,7 @@ TEST_F(TestMockManagedLockBreakRequest, ForceBreak) {
{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123},
0);

expect_blacklist_add(mock_image_ctx, 0);
expect_blocklist_add(mock_image_ctx, 0);
expect_wait_for_latest_osd_map(mock_image_ctx, 0);
expect_break_lock(mock_image_ctx, 0);

Expand Down Expand Up @@ -341,7 +341,7 @@ TEST_F(TestMockManagedLockBreakRequest, GetLockerError) {
ASSERT_EQ(-EINVAL, ctx.wait());
}

TEST_F(TestMockManagedLockBreakRequest, BlacklistDisabled) {
TEST_F(TestMockManagedLockBreakRequest, BlocklistDisabled) {
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

librbd::ImageCtx *ictx;
Expand Down Expand Up @@ -369,7 +369,7 @@ TEST_F(TestMockManagedLockBreakRequest, BlacklistDisabled) {
ASSERT_EQ(0, ctx.wait());
}

TEST_F(TestMockManagedLockBreakRequest, BlacklistSelf) {
TEST_F(TestMockManagedLockBreakRequest, BlocklistSelf) {
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

librbd::ImageCtx *ictx;
Expand Down Expand Up @@ -397,7 +397,7 @@ TEST_F(TestMockManagedLockBreakRequest, BlacklistSelf) {
ASSERT_EQ(-EINVAL, ctx.wait());
}

TEST_F(TestMockManagedLockBreakRequest, BlacklistError) {
TEST_F(TestMockManagedLockBreakRequest, BlocklistError) {
REQUIRE_FEATURE(RBD_FEATURE_EXCLUSIVE_LOCK);

librbd::ImageCtx *ictx;
Expand All @@ -414,7 +414,7 @@ TEST_F(TestMockManagedLockBreakRequest, BlacklistError) {
{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123},
0);

expect_blacklist_add(mock_image_ctx, -EINVAL);
expect_blocklist_add(mock_image_ctx, -EINVAL);

C_SaferCond ctx;
Locker locker{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123};
Expand Down Expand Up @@ -442,7 +442,7 @@ TEST_F(TestMockManagedLockBreakRequest, BreakLockMissing) {
{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123},
0);

expect_blacklist_add(mock_image_ctx, 0);
expect_blocklist_add(mock_image_ctx, 0);
expect_wait_for_latest_osd_map(mock_image_ctx, 0);
expect_break_lock(mock_image_ctx, -ENOENT);

Expand Down Expand Up @@ -472,7 +472,7 @@ TEST_F(TestMockManagedLockBreakRequest, BreakLockError) {
{entity_name_t::CLIENT(1), "auto 123", "1.2.3.4:0/0", 123},
0);

expect_blacklist_add(mock_image_ctx, 0);
expect_blocklist_add(mock_image_ctx, 0);
expect_wait_for_latest_osd_map(mock_image_ctx, 0);
expect_break_lock(mock_image_ctx, -EINVAL);

Expand Down
2 changes: 1 addition & 1 deletion src/test/librbd/mock/MockImageWatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ProgressContext;
struct MockImageWatcher {
MOCK_METHOD0(is_registered, bool());
MOCK_METHOD0(is_unregistered, bool());
MOCK_METHOD0(is_blacklisted, bool());
MOCK_METHOD0(is_blocklisted, bool());
MOCK_METHOD0(unregister_watch, void());
MOCK_METHOD1(flush, void(Context *));

Expand Down
2 changes: 1 addition & 1 deletion src/test/librbd/rbdrw.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
happens, split off the last number in the exception 'args' string
and use it as the process exit code, if it's convertible to a number.

Designed to run against a blacklist operation and verify the
Designed to run against a blocklist operation and verify the
ESHUTDOWN expected from the image operation.

Note: this cannot be run with writeback caching on, currently, as
Expand Down
28 changes: 14 additions & 14 deletions src/test/librbd/test_librbd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6851,25 +6851,25 @@ TEST_F(TestLibRBD, BreakLock)

static char buf[10];

rados_t blacklist_cluster;
ASSERT_EQ("", connect_cluster(&blacklist_cluster));
rados_t blocklist_cluster;
ASSERT_EQ("", connect_cluster(&blocklist_cluster));

rados_ioctx_t ioctx, blacklist_ioctx;
rados_ioctx_t ioctx, blocklist_ioctx;
ASSERT_EQ(0, rados_ioctx_create(_cluster, m_pool_name.c_str(), &ioctx));
ASSERT_EQ(0, rados_ioctx_create(blacklist_cluster, m_pool_name.c_str(),
&blacklist_ioctx));
ASSERT_EQ(0, rados_ioctx_create(blocklist_cluster, m_pool_name.c_str(),
&blocklist_ioctx));

std::string name = get_temp_image_name();
uint64_t size = 2 << 20;
int order = 0;
ASSERT_EQ(0, create_image(ioctx, name.c_str(), size, &order));

rbd_image_t image, blacklist_image;
rbd_image_t image, blocklist_image;
ASSERT_EQ(0, rbd_open(ioctx, name.c_str(), &image, NULL));
ASSERT_EQ(0, rbd_open(blacklist_ioctx, name.c_str(), &blacklist_image, NULL));
ASSERT_EQ(0, rbd_open(blocklist_ioctx, name.c_str(), &blocklist_image, NULL));

ASSERT_EQ(0, rbd_metadata_set(image, "conf_rbd_blacklist_on_break_lock", "true"));
ASSERT_EQ(0, rbd_lock_acquire(blacklist_image, RBD_LOCK_MODE_EXCLUSIVE));
ASSERT_EQ(0, rbd_metadata_set(image, "conf_rbd_blocklist_on_break_lock", "true"));
ASSERT_EQ(0, rbd_lock_acquire(blocklist_image, RBD_LOCK_MODE_EXCLUSIVE));

rbd_lock_mode_t lock_mode;
char *lock_owners[1];
Expand All @@ -6882,19 +6882,19 @@ TEST_F(TestLibRBD, BreakLock)

ASSERT_EQ(0, rbd_lock_break(image, RBD_LOCK_MODE_EXCLUSIVE, lock_owners[0]));
ASSERT_EQ(0, rbd_lock_acquire(image, RBD_LOCK_MODE_EXCLUSIVE));
EXPECT_EQ(0, rados_wait_for_latest_osdmap(blacklist_cluster));
EXPECT_EQ(0, rados_wait_for_latest_osdmap(blocklist_cluster));

ASSERT_EQ((ssize_t)sizeof(buf), rbd_write(image, 0, sizeof(buf), buf));
ASSERT_EQ(-EBLACKLISTED, rbd_write(blacklist_image, 0, sizeof(buf), buf));
ASSERT_EQ(-EBLOCKLISTED, rbd_write(blocklist_image, 0, sizeof(buf), buf));

ASSERT_EQ(0, rbd_close(image));
ASSERT_EQ(0, rbd_close(blacklist_image));
ASSERT_EQ(0, rbd_close(blocklist_image));

rbd_lock_get_owners_cleanup(lock_owners, max_lock_owners);

rados_ioctx_destroy(ioctx);
rados_ioctx_destroy(blacklist_ioctx);
rados_shutdown(blacklist_cluster);
rados_ioctx_destroy(blocklist_ioctx);
rados_shutdown(blocklist_cluster);
}

TEST_F(TestLibRBD, DiscardAfterWrite)
Expand Down
8 changes: 4 additions & 4 deletions src/test/librbd/test_mock_ExclusiveLock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ template <>
struct ManagedLock<MockExclusiveLockImageCtx> {
ManagedLock(librados::IoCtx& ioctx, AsioEngine& asio_engine,
const std::string& oid, librbd::MockImageWatcher *watcher,
managed_lock::Mode mode, bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds)
managed_lock::Mode mode, bool blocklist_on_break_lock,
uint32_t blocklist_expire_seconds)
{}

virtual ~ManagedLock() = default;
Expand Down Expand Up @@ -663,8 +663,8 @@ TEST_F(TestMockExclusiveLock, AcquireLockError) {
expect_is_state_acquiring(exclusive_lock, true);
expect_prepare_lock_complete(mock_image_ctx);
expect_is_action_acquire_lock(exclusive_lock, true);
ASSERT_EQ(-EBLACKLISTED, when_post_acquire_lock_handler(exclusive_lock,
-EBLACKLISTED));
ASSERT_EQ(-EBLOCKLISTED, when_post_acquire_lock_handler(exclusive_lock,
-EBLOCKLISTED));
}

TEST_F(TestMockExclusiveLock, PostAcquireLockError) {
Expand Down
32 changes: 16 additions & 16 deletions src/test/librbd/test_mock_ManagedLock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ struct Traits<MockManagedLockImageCtx> {
struct MockMockManagedLock : public ManagedLock<MockManagedLockImageCtx> {
MockMockManagedLock(librados::IoCtx& ioctx, AsioEngine& asio_engine,
const std::string& oid, librbd::MockImageWatcher *watcher,
managed_lock::Mode mode, bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds)
managed_lock::Mode mode, bool blocklist_on_break_lock,
uint32_t blocklist_expire_seconds)
: ManagedLock<MockManagedLockImageCtx>(ioctx, asio_engine, oid, watcher,
librbd::managed_lock::EXCLUSIVE, true, 0) {
};
Expand Down Expand Up @@ -75,8 +75,8 @@ struct AcquireRequest<MockManagedLockImageCtx>
AsioEngine& asio_engine,
const std::string& oid,
const std::string& cookie,
bool exclusive, bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds,
bool exclusive, bool blocklist_on_break_lock,
uint32_t blocklist_expire_seconds,
Context *on_finish) {
return BaseRequest::create(ioctx, watcher, oid, cookie, on_finish);
}
Expand Down Expand Up @@ -125,8 +125,8 @@ struct BreakRequest<MockManagedLockImageCtx> {
static BreakRequest* create(librados::IoCtx& ioctx,
AsioEngine& asio_engine,
const std::string& oid, const Locker &locker,
bool exclusive, bool blacklist_locker,
uint32_t blacklist_expire_seconds,
bool exclusive, bool blocklist_locker,
uint32_t blocklist_expire_seconds,
bool force_break_lock, Context *on_finish) {
ceph_abort_msg("unexpected call");
}
Expand Down Expand Up @@ -372,7 +372,7 @@ TEST_F(TestMockManagedLock, AcquireLockError) {
ASSERT_EQ(0, when_shut_down(managed_lock));
}

TEST_F(TestMockManagedLock, AcquireLockBlacklist) {
TEST_F(TestMockManagedLock, AcquireLockBlocklist) {
librbd::ImageCtx *ictx;
ASSERT_EQ(0, open_image(m_image_name, &ictx));

Expand All @@ -382,10 +382,10 @@ TEST_F(TestMockManagedLock, AcquireLockBlacklist) {
librbd::managed_lock::EXCLUSIVE, true, 0);
InSequence seq;

// will abort after seeing blacklist error (avoid infinite request loop)
// will abort after seeing blocklist error (avoid infinite request loop)
MockAcquireRequest request_lock_acquire;
expect_acquire_lock(*mock_image_ctx.image_watcher, ictx->op_work_queue, request_lock_acquire, -EBLACKLISTED);
ASSERT_EQ(-EBLACKLISTED, when_acquire_lock(managed_lock));
expect_acquire_lock(*mock_image_ctx.image_watcher, ictx->op_work_queue, request_lock_acquire, -EBLOCKLISTED);
ASSERT_EQ(-EBLOCKLISTED, when_acquire_lock(managed_lock));
ASSERT_FALSE(is_lock_owner(managed_lock));

ASSERT_EQ(0, when_shut_down(managed_lock));
Expand All @@ -406,7 +406,7 @@ TEST_F(TestMockManagedLock, ReleaseLockUnlockedState) {
ASSERT_EQ(0, when_shut_down(managed_lock));
}

TEST_F(TestMockManagedLock, ReleaseLockBlacklist) {
TEST_F(TestMockManagedLock, ReleaseLockBlocklist) {
librbd::ImageCtx *ictx;
ASSERT_EQ(0, open_image(m_image_name, &ictx));

Expand All @@ -420,9 +420,9 @@ TEST_F(TestMockManagedLock, ReleaseLockBlacklist) {
expect_acquire_lock(*mock_image_ctx.image_watcher, ictx->op_work_queue, try_lock_acquire, 0);
ASSERT_EQ(0, when_acquire_lock(managed_lock));

expect_pre_release_lock_handler(managed_lock, false, -EBLACKLISTED);
expect_post_release_lock_handler(managed_lock, false, -EBLACKLISTED, -EBLACKLISTED);
ASSERT_EQ(-EBLACKLISTED, when_release_lock(managed_lock));
expect_pre_release_lock_handler(managed_lock, false, -EBLOCKLISTED);
expect_post_release_lock_handler(managed_lock, false, -EBLOCKLISTED, -EBLOCKLISTED);
ASSERT_EQ(-EBLOCKLISTED, when_release_lock(managed_lock));
ASSERT_FALSE(is_lock_owner(managed_lock));

ASSERT_EQ(0, when_shut_down(managed_lock));
Expand Down Expand Up @@ -539,7 +539,7 @@ TEST_F(TestMockManagedLock, ReacquireLock) {
ASSERT_FALSE(is_lock_owner(managed_lock));
}

TEST_F(TestMockManagedLock, AttemptReacquireBlacklistedLock) {
TEST_F(TestMockManagedLock, AttemptReacquireBlocklistedLock) {
librbd::ImageCtx *ictx;
ASSERT_EQ(0, open_image(m_image_name, &ictx));

Expand Down Expand Up @@ -568,7 +568,7 @@ TEST_F(TestMockManagedLock, AttemptReacquireBlacklistedLock) {
ASSERT_FALSE(is_lock_owner(managed_lock));
}

TEST_F(TestMockManagedLock, ReacquireBlacklistedLock) {
TEST_F(TestMockManagedLock, ReacquireBlocklistedLock) {
librbd::ImageCtx *ictx;
ASSERT_EQ(0, open_image(m_image_name, &ictx));

Expand Down
6 changes: 3 additions & 3 deletions src/test/librbd/test_mock_Watcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ TEST_F(TestMockWatcher, ReregisterWatchBlacklist) {

// wait for recovery unwatch/watch
ASSERT_TRUE(wait_for_watch(mock_image_ctx, 2));
ASSERT_TRUE(mock_image_watcher.is_blacklisted());
ASSERT_TRUE(mock_image_watcher.is_blocklisted());

C_SaferCond unregister_ctx;
mock_image_watcher.unregister_watch(&unregister_ctx);
Expand All @@ -324,7 +324,7 @@ TEST_F(TestMockWatcher, ReregisterUnwatchPendingUnregister) {

// inject an unregister
C_SaferCond unregister_ctx;
expect_aio_unwatch(mock_image_ctx, -EBLACKLISTED,
expect_aio_unwatch(mock_image_ctx, -EBLOCKLISTED,
[&mock_image_watcher, &unregister_ctx]() {
mock_image_watcher.unregister_watch(&unregister_ctx);
});
Expand All @@ -334,7 +334,7 @@ TEST_F(TestMockWatcher, ReregisterUnwatchPendingUnregister) {
ASSERT_EQ(0, register_ctx.wait());

ceph_assert(m_watch_ctx != nullptr);
m_watch_ctx->handle_error(0, -EBLACKLISTED);
m_watch_ctx->handle_error(0, -EBLOCKLISTED);

ASSERT_EQ(0, unregister_ctx.wait());
}
Expand Down
24 changes: 12 additions & 12 deletions src/test/pybind/test_ceph_argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,10 @@ def test_lspools(self):
assert_equal({}, validate_command(sigdict, ['osd', 'lspools',
'toomany']))

def test_blacklist_ls(self):
self.assert_valid_command(['osd', 'blacklist', 'ls'])
assert_equal({}, validate_command(sigdict, ['osd', 'blacklist']))
assert_equal({}, validate_command(sigdict, ['osd', 'blacklist',
def test_blocklist_ls(self):
self.assert_valid_command(['osd', 'blocklist', 'ls'])
assert_equal({}, validate_command(sigdict, ['osd', 'blocklist']))
assert_equal({}, validate_command(sigdict, ['osd', 'blocklist',
'ls', 'toomany']))

def test_crush_rule(self):
Expand Down Expand Up @@ -878,25 +878,25 @@ def test_create(self):
uuid,
'toomany']))

def test_blacklist(self):
def test_blocklist(self):
for action in ('add', 'rm'):
self.assert_valid_command(['osd', 'blacklist', action,
self.assert_valid_command(['osd', 'blocklist', action,
'1.2.3.4/567'])
self.assert_valid_command(['osd', 'blacklist', action,
self.assert_valid_command(['osd', 'blocklist', action,
'1.2.3.4'])
self.assert_valid_command(['osd', 'blacklist', action,
self.assert_valid_command(['osd', 'blocklist', action,
'1.2.3.4/567', '600.40'])
self.assert_valid_command(['osd', 'blacklist', action,
self.assert_valid_command(['osd', 'blocklist', action,
'1.2.3.4', '600.40'])
assert_equal({}, validate_command(sigdict, ['osd', 'blacklist',
assert_equal({}, validate_command(sigdict, ['osd', 'blocklist',
action,
'invalid',
'600.40']))
assert_equal({}, validate_command(sigdict, ['osd', 'blacklist',
assert_equal({}, validate_command(sigdict, ['osd', 'blocklist',
action,
'1.2.3.4/567',
'-1.0']))
assert_equal({}, validate_command(sigdict, ['osd', 'blacklist',
assert_equal({}, validate_command(sigdict, ['osd', 'blocklist',
action,
'1.2.3.4/567',
'600.40',
Expand Down
6 changes: 3 additions & 3 deletions src/test/pybind/test_rados.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _requires_connected(self, rados):
assert_raises(RadosStateError, rados.osd_command, 0, '', b'')
assert_raises(RadosStateError, rados.pg_command, '', '', b'')
assert_raises(RadosStateError, rados.wait_for_latest_osdmap)
assert_raises(RadosStateError, rados.blacklist_add, '127.0.0.1/123', 0)
assert_raises(RadosStateError, rados.blocklist_add, '127.0.0.1/123', 0)

def test_configuring(self):
rados = Rados(conffile='')
Expand Down Expand Up @@ -236,8 +236,8 @@ def test_get_fsid(self):
fsid = self.rados.get_fsid()
assert re.match('[0-9a-f\-]{36}', fsid, re.I)

def test_blacklist_add(self):
self.rados.blacklist_add("1.2.3.4/123", 1)
def test_blocklist_add(self):
self.rados.blocklist_add("1.2.3.4/123", 1)

@attr('stats')
def test_get_cluster_stats(self):
Expand Down
38 changes: 19 additions & 19 deletions src/test/pybind/test_rbd.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ def _require_features(*args, **kwargs):
return functools.wraps(fn)(_require_features)
return wrapper

def blacklist_features(blacklisted_features):
def blocklist_features(blocklisted_features):
def wrapper(fn):
def _blacklist_features(*args, **kwargs):
def _blocklist_features(*args, **kwargs):
global features
for feature in blacklisted_features:
for feature in blocklisted_features:
if features is not None and feature & features == feature:
raise SkipTest
return fn(*args, **kwargs)
return functools.wraps(fn)(_blacklist_features)
return functools.wraps(fn)(_blocklist_features)
return wrapper

def test_version():
Expand Down Expand Up @@ -528,7 +528,7 @@ def tearDown(self):
self.image = None

@require_new_format()
@blacklist_features([RBD_FEATURE_EXCLUSIVE_LOCK])
@blocklist_features([RBD_FEATURE_EXCLUSIVE_LOCK])
def test_update_features(self):
features = self.image.features()
self.image.update_features(RBD_FEATURE_EXCLUSIVE_LOCK, True)
Expand Down Expand Up @@ -907,13 +907,13 @@ def test_limit_snaps(self):
def test_remove_with_exclusive_lock(self):
assert_raises(ImageBusy, remove_image)

@blacklist_features([RBD_FEATURE_EXCLUSIVE_LOCK])
@blocklist_features([RBD_FEATURE_EXCLUSIVE_LOCK])
def test_remove_with_snap(self):
self.image.create_snap('snap1')
assert_raises(ImageHasSnapshots, remove_image)
self.image.remove_snap('snap1')

@blacklist_features([RBD_FEATURE_EXCLUSIVE_LOCK])
@blocklist_features([RBD_FEATURE_EXCLUSIVE_LOCK])
def test_remove_with_watcher(self):
data = rand_data(256)
self.image.write(data, 0)
Expand Down Expand Up @@ -1915,19 +1915,19 @@ def test_acquire_release_lock(self):
image.lock_release()

def test_break_lock(self):
blacklist_rados = Rados(conffile='')
blacklist_rados.connect()
blocklist_rados = Rados(conffile='')
blocklist_rados.connect()
try:
blacklist_ioctx = blacklist_rados.open_ioctx(pool_name)
blocklist_ioctx = blocklist_rados.open_ioctx(pool_name)
try:
rados2.conf_set('rbd_blacklist_on_break_lock', 'true')
rados2.conf_set('rbd_blocklist_on_break_lock', 'true')
with Image(ioctx2, image_name) as image, \
Image(blacklist_ioctx, image_name) as blacklist_image:
Image(blocklist_ioctx, image_name) as blocklist_image:

lock_owners = list(image.lock_get_owners())
eq(0, len(lock_owners))

blacklist_image.lock_acquire(RBD_LOCK_MODE_EXCLUSIVE)
blocklist_image.lock_acquire(RBD_LOCK_MODE_EXCLUSIVE)
assert_raises(ReadOnlyImage, image.lock_acquire,
RBD_LOCK_MODE_EXCLUSIVE)
lock_owners = list(image.lock_get_owners())
Expand All @@ -1937,23 +1937,23 @@ def test_break_lock(self):
lock_owners[0]['owner'])

assert_raises(ConnectionShutdown,
blacklist_image.is_exclusive_lock_owner)
blocklist_image.is_exclusive_lock_owner)

blacklist_rados.wait_for_latest_osdmap()
blocklist_rados.wait_for_latest_osdmap()
data = rand_data(256)
assert_raises(ConnectionShutdown,
blacklist_image.write, data, 0)
blocklist_image.write, data, 0)

image.lock_acquire(RBD_LOCK_MODE_EXCLUSIVE)

try:
blacklist_image.close()
blocklist_image.close()
except ConnectionShutdown:
pass
finally:
blacklist_ioctx.close()
blocklist_ioctx.close()
finally:
blacklist_rados.shutdown()
blocklist_rados.shutdown()

class TestMirroring(object):

Expand Down
6 changes: 3 additions & 3 deletions src/test/rbd_mirror/test_mock_ImageMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1308,17 +1308,17 @@ TEST_F(TestMockImageMap, AddErrorAndRemoveImage) {
expect_listener_images_unmapped(mock_listener, 1, &released_global_image_ids,
&release_peer_ack_ctxs);

// instance blacklisted -- ACQUIRE request fails
// instance blocklisted -- ACQUIRE request fails
remote_peer_ack_nowait(mock_image_map.get(), shuffled_global_image_ids,
-EBLACKLISTED, &peer_ack_ctxs);
-EBLOCKLISTED, &peer_ack_ctxs);
ASSERT_TRUE(wait_for_listener_notify(shuffled_global_image_ids.size()));

std::map<std::string, Context*> remap_peer_ack_ctxs;
update_map_and_acquire(mock_threads, mock_update_request,
mock_listener, shuffled_global_image_ids, 0,
&remap_peer_ack_ctxs);

// instance blacklisted -- RELEASE request fails
// instance blocklisted -- RELEASE request fails
remote_peer_ack_listener_wait(mock_image_map.get(), shuffled_global_image_ids,
-ENOENT, &release_peer_ack_ctxs);
wait_for_scheduled_task();
Expand Down
10 changes: 5 additions & 5 deletions src/test/rbd_mirror/test_mock_InstanceReplayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct ImageReplayer<librbd::MockTestImageCtx> {
MOCK_METHOD0(get_local_image_id, const std::string &());
MOCK_METHOD0(is_running, bool());
MOCK_METHOD0(is_stopped, bool());
MOCK_METHOD0(is_blacklisted, bool());
MOCK_METHOD0(is_blocklisted, bool());

MOCK_CONST_METHOD0(is_finished, bool());
MOCK_METHOD1(set_finished, void(bool));
Expand Down Expand Up @@ -199,7 +199,7 @@ TEST_F(TestMockInstanceReplayer, AcquireReleaseImage) {
C_SaferCond on_acquire;
EXPECT_CALL(mock_image_replayer, add_peer(_));
EXPECT_CALL(mock_image_replayer, is_stopped()).WillOnce(Return(true));
EXPECT_CALL(mock_image_replayer, is_blacklisted()).WillOnce(Return(false));
EXPECT_CALL(mock_image_replayer, is_blocklisted()).WillOnce(Return(false));
EXPECT_CALL(mock_image_replayer, is_finished()).WillOnce(Return(false));
EXPECT_CALL(mock_image_replayer, start(_, false))
.WillOnce(CompleteContext(0));
Expand Down Expand Up @@ -270,7 +270,7 @@ TEST_F(TestMockInstanceReplayer, RemoveFinishedImage) {
C_SaferCond on_acquire;
EXPECT_CALL(mock_image_replayer, add_peer(_));
EXPECT_CALL(mock_image_replayer, is_stopped()).WillOnce(Return(true));
EXPECT_CALL(mock_image_replayer, is_blacklisted()).WillOnce(Return(false));
EXPECT_CALL(mock_image_replayer, is_blocklisted()).WillOnce(Return(false));
EXPECT_CALL(mock_image_replayer, is_finished()).WillOnce(Return(false));
EXPECT_CALL(mock_image_replayer, start(_, false))
.WillOnce(CompleteContext(0));
Expand Down Expand Up @@ -300,7 +300,7 @@ TEST_F(TestMockInstanceReplayer, RemoveFinishedImage) {
EXPECT_CALL(mock_image_replayer, get_health_state()).WillOnce(
Return(image_replayer::HEALTH_STATE_OK));
EXPECT_CALL(mock_image_replayer, is_stopped()).WillOnce(Return(true));
EXPECT_CALL(mock_image_replayer, is_blacklisted()).WillOnce(Return(false));
EXPECT_CALL(mock_image_replayer, is_blocklisted()).WillOnce(Return(false));
EXPECT_CALL(mock_image_replayer, is_finished()).WillOnce(Return(true));
EXPECT_CALL(mock_image_replayer, destroy());
EXPECT_CALL(mock_service_daemon,
Expand Down Expand Up @@ -344,7 +344,7 @@ TEST_F(TestMockInstanceReplayer, Reacquire) {

EXPECT_CALL(mock_image_replayer, add_peer(_));
EXPECT_CALL(mock_image_replayer, is_stopped()).WillOnce(Return(true));
EXPECT_CALL(mock_image_replayer, is_blacklisted()).WillOnce(Return(false));
EXPECT_CALL(mock_image_replayer, is_blocklisted()).WillOnce(Return(false));
EXPECT_CALL(mock_image_replayer, is_finished()).WillOnce(Return(false));
EXPECT_CALL(mock_image_replayer, start(_, false))
.WillOnce(CompleteContext(0));
Expand Down
8 changes: 4 additions & 4 deletions src/test/rbd_mirror/test_mock_InstanceWatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ struct ManagedLock<MockTestImageCtx> {
librbd::AsioEngine& asio_engine,
const std::string& oid, librbd::Watcher *watcher,
managed_lock::Mode mode,
bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds) {
bool blocklist_on_break_lock,
uint32_t blocklist_expire_seconds) {
ceph_assert(s_instance != nullptr);
return s_instance;
}
Expand Down Expand Up @@ -563,7 +563,7 @@ TEST_F(TestMockInstanceWatcher, PeerImageAcquireWatchDNE) {
expect_acquire_lock(mock_managed_lock, 0);
ASSERT_EQ(0, instance_watcher->init());

// Acquire image on dead (blacklisted) instance
// Acquire image on dead (blocklisted) instance
C_SaferCond on_acquire;
instance_watcher->notify_image_acquire("dead instance", "global image id",
&on_acquire);
Expand Down Expand Up @@ -595,7 +595,7 @@ TEST_F(TestMockInstanceWatcher, PeerImageReleaseWatchDNE) {
expect_acquire_lock(mock_managed_lock, 0);
ASSERT_EQ(0, instance_watcher->init());

// Release image on dead (blacklisted) instance
// Release image on dead (blocklisted) instance
C_SaferCond on_acquire;
instance_watcher->notify_image_release("dead instance", "global image id",
&on_acquire);
Expand Down
4 changes: 2 additions & 2 deletions src/test/rbd_mirror/test_mock_LeaderWatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ template <>
struct ManagedLock<MockTestImageCtx> {
ManagedLock(librados::IoCtx& ioctx, librbd::AsioEngine& asio_engine,
const std::string& oid, librbd::Watcher *watcher,
managed_lock::Mode mode, bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds)
managed_lock::Mode mode, bool blocklist_on_break_lock,
uint32_t blocklist_expire_seconds)
: m_work_queue(asio_engine.get_work_queue()) {
MockManagedLock::get_instance().construct();
}
Expand Down
2 changes: 1 addition & 1 deletion src/test/rbd_mirror/test_mock_NamespaceReplayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ struct PoolWatcher<librbd::MockTestImageCtx> {
return s_instances[pool_id];
}

MOCK_METHOD0(is_blacklisted, bool());
MOCK_METHOD0(is_blocklisted, bool());

MOCK_METHOD0(get_image_count, uint64_t());

Expand Down
42 changes: 21 additions & 21 deletions src/test/rbd_mirror/test_mock_PoolReplayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ struct NamespaceReplayer<librbd::MockTestImageCtx> {
return namespace_replayer;
}

MOCK_METHOD0(is_blacklisted, bool());
MOCK_METHOD0(is_blocklisted, bool());
MOCK_METHOD0(get_instance_id, std::string());

MOCK_METHOD1(init, void(Context*));
Expand Down Expand Up @@ -186,7 +186,7 @@ struct LeaderWatcher<librbd::MockTestImageCtx> {
return s_instance;
}

MOCK_METHOD0(is_blacklisted, bool());
MOCK_METHOD0(is_blocklisted, bool());
MOCK_METHOD0(is_leader, bool());
MOCK_METHOD0(release_leader, void());

Expand Down Expand Up @@ -410,17 +410,17 @@ class TestMockPoolReplayer : public TestMockFixture {
}));
}

void expect_leader_watcher_is_blacklisted(
MockLeaderWatcher &mock_leader_watcher, bool blacklisted) {
EXPECT_CALL(mock_leader_watcher, is_blacklisted())
.WillRepeatedly(Return(blacklisted));
void expect_leader_watcher_is_blocklisted(
MockLeaderWatcher &mock_leader_watcher, bool blocklisted) {
EXPECT_CALL(mock_leader_watcher, is_blocklisted())
.WillRepeatedly(Return(blocklisted));
}

void expect_namespace_replayer_is_blacklisted(
void expect_namespace_replayer_is_blocklisted(
MockNamespaceReplayer &mock_namespace_replayer,
bool blacklisted) {
EXPECT_CALL(mock_namespace_replayer, is_blacklisted())
.WillRepeatedly(Return(blacklisted));
bool blocklisted) {
EXPECT_CALL(mock_namespace_replayer, is_blocklisted())
.WillRepeatedly(Return(blocklisted));
}

void expect_namespace_replayer_get_instance_id(
Expand Down Expand Up @@ -542,15 +542,15 @@ TEST_F(TestMockPoolReplayer, ConfigKeyOverride) {
peer_spec.key = "234";

auto mock_default_namespace_replayer = new MockNamespaceReplayer();
expect_namespace_replayer_is_blacklisted(*mock_default_namespace_replayer,
expect_namespace_replayer_is_blocklisted(*mock_default_namespace_replayer,
false);

MockThreads mock_threads(m_threads);
expect_work_queue(mock_threads);

auto mock_leader_watcher = new MockLeaderWatcher();
expect_leader_watcher_get_leader_instance_id(*mock_leader_watcher);
expect_leader_watcher_is_blacklisted(*mock_leader_watcher, false);
expect_leader_watcher_is_blocklisted(*mock_leader_watcher, false);

InSequence seq;

Expand Down Expand Up @@ -604,7 +604,7 @@ TEST_F(TestMockPoolReplayer, AcquireReleaseLeader) {
peer_spec.key = "234";

auto mock_default_namespace_replayer = new MockNamespaceReplayer();
expect_namespace_replayer_is_blacklisted(*mock_default_namespace_replayer,
expect_namespace_replayer_is_blocklisted(*mock_default_namespace_replayer,
false);

MockThreads mock_threads(m_threads);
Expand All @@ -613,7 +613,7 @@ TEST_F(TestMockPoolReplayer, AcquireReleaseLeader) {
auto mock_leader_watcher = new MockLeaderWatcher();
expect_leader_watcher_get_leader_instance_id(*mock_leader_watcher);
expect_leader_watcher_list_instances(*mock_leader_watcher);
expect_leader_watcher_is_blacklisted(*mock_leader_watcher, false);
expect_leader_watcher_is_blocklisted(*mock_leader_watcher, false);

InSequence seq;

Expand Down Expand Up @@ -684,15 +684,15 @@ TEST_F(TestMockPoolReplayer, Namespaces) {
MockNamespace mock_namespace;

auto mock_default_namespace_replayer = new MockNamespaceReplayer();
expect_namespace_replayer_is_blacklisted(*mock_default_namespace_replayer,
expect_namespace_replayer_is_blocklisted(*mock_default_namespace_replayer,
false);

auto mock_ns1_namespace_replayer = new MockNamespaceReplayer("ns1");
expect_namespace_replayer_is_blacklisted(*mock_ns1_namespace_replayer,
expect_namespace_replayer_is_blocklisted(*mock_ns1_namespace_replayer,
false);

auto mock_ns2_namespace_replayer = new MockNamespaceReplayer("ns2");
expect_namespace_replayer_is_blacklisted(*mock_ns2_namespace_replayer,
expect_namespace_replayer_is_blocklisted(*mock_ns2_namespace_replayer,
false);

MockThreads mock_threads(m_threads);
Expand All @@ -701,7 +701,7 @@ TEST_F(TestMockPoolReplayer, Namespaces) {
auto mock_leader_watcher = new MockLeaderWatcher();
expect_leader_watcher_get_leader_instance_id(*mock_leader_watcher);
expect_leader_watcher_list_instances(*mock_leader_watcher);
expect_leader_watcher_is_blacklisted(*mock_leader_watcher, false);
expect_leader_watcher_is_blocklisted(*mock_leader_watcher, false);

auto& mock_cluster = get_mock_cluster();
auto mock_local_rados_client = mock_cluster.do_create_rados_client(
Expand Down Expand Up @@ -805,11 +805,11 @@ TEST_F(TestMockPoolReplayer, NamespacesError) {
MockNamespace mock_namespace;

auto mock_default_namespace_replayer = new MockNamespaceReplayer();
expect_namespace_replayer_is_blacklisted(*mock_default_namespace_replayer,
expect_namespace_replayer_is_blocklisted(*mock_default_namespace_replayer,
false);
auto mock_ns1_namespace_replayer = new MockNamespaceReplayer("ns1");
auto mock_ns2_namespace_replayer = new MockNamespaceReplayer("ns2");
expect_namespace_replayer_is_blacklisted(*mock_ns2_namespace_replayer,
expect_namespace_replayer_is_blocklisted(*mock_ns2_namespace_replayer,
false);
auto mock_ns3_namespace_replayer = new MockNamespaceReplayer("ns3");

Expand All @@ -819,7 +819,7 @@ TEST_F(TestMockPoolReplayer, NamespacesError) {
auto mock_leader_watcher = new MockLeaderWatcher();
expect_leader_watcher_get_leader_instance_id(*mock_leader_watcher);
expect_leader_watcher_list_instances(*mock_leader_watcher);
expect_leader_watcher_is_blacklisted(*mock_leader_watcher, false);
expect_leader_watcher_is_blocklisted(*mock_leader_watcher, false);

auto& mock_cluster = get_mock_cluster();
auto mock_local_rados_client = mock_cluster.do_create_rados_client(
Expand Down
16 changes: 8 additions & 8 deletions src/test/rbd_mirror/test_mock_PoolWatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ TEST_F(TestMockPoolWatcher, RegisterWatcherBlacklist) {
C_SaferCond ctx;
mock_pool_watcher.init(&ctx);
ASSERT_EQ(-EBLACKLISTED, ctx.wait());
ASSERT_TRUE(mock_pool_watcher.is_blacklisted());
ASSERT_TRUE(mock_pool_watcher.is_blocklisted());

expect_mirroring_watcher_unregister(mock_mirroring_watcher, 0);
ASSERT_EQ(0, when_shut_down(mock_pool_watcher));
Expand Down Expand Up @@ -509,7 +509,7 @@ TEST_F(TestMockPoolWatcher, RegisterWatcherError) {
ASSERT_EQ(0, when_shut_down(mock_pool_watcher));
}

TEST_F(TestMockPoolWatcher, RefreshBlacklist) {
TEST_F(TestMockPoolWatcher, RefreshBlocklist) {
MockThreads mock_threads(m_threads);
expect_work_queue(mock_threads);

Expand All @@ -519,15 +519,15 @@ TEST_F(TestMockPoolWatcher, RefreshBlacklist) {
expect_mirroring_watcher_register(mock_mirroring_watcher, 0);

MockRefreshImagesRequest mock_refresh_images_request;
expect_refresh_images(mock_refresh_images_request, {}, -EBLACKLISTED);
expect_refresh_images(mock_refresh_images_request, {}, -EBLOCKLISTED);

MockListener mock_listener(this);
MockPoolWatcher mock_pool_watcher(&mock_threads, m_remote_io_ctx,
"remote uuid", mock_listener);
C_SaferCond ctx;
mock_pool_watcher.init(&ctx);
ASSERT_EQ(-EBLACKLISTED, ctx.wait());
ASSERT_TRUE(mock_pool_watcher.is_blacklisted());
ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
ASSERT_TRUE(mock_pool_watcher.is_blocklisted());

expect_mirroring_watcher_unregister(mock_mirroring_watcher, 0);
ASSERT_EQ(0, when_shut_down(mock_pool_watcher));
Expand Down Expand Up @@ -624,7 +624,7 @@ TEST_F(TestMockPoolWatcher, Rewatch) {
ASSERT_EQ(0, when_shut_down(mock_pool_watcher));
}

TEST_F(TestMockPoolWatcher, RewatchBlacklist) {
TEST_F(TestMockPoolWatcher, RewatchBlocklist) {
MockThreads mock_threads(m_threads);
expect_work_queue(mock_threads);

Expand All @@ -646,8 +646,8 @@ TEST_F(TestMockPoolWatcher, RewatchBlacklist) {
ASSERT_EQ(0, ctx.wait());
ASSERT_TRUE(wait_for_update(1));

MirroringWatcher::get_instance().handle_rewatch_complete(-EBLACKLISTED);
ASSERT_TRUE(mock_pool_watcher.is_blacklisted());
MirroringWatcher::get_instance().handle_rewatch_complete(-EBLOCKLISTED);
ASSERT_TRUE(mock_pool_watcher.is_blocklisted());

expect_mirroring_watcher_unregister(mock_mirroring_watcher, 0);
ASSERT_EQ(0, when_shut_down(mock_pool_watcher));
Expand Down
36 changes: 18 additions & 18 deletions src/test/rgw/test_rgw_iam_policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -850,11 +850,11 @@ class IPPolicyTest : public ::testing::Test {
// 192.168.1.0/24
const rgw::IAM::MaskedIP allowedIPv4Range = { false, rgw::IAM::Address("11000000101010000000000100000000"), 24 };
// 192.168.1.1/32
const rgw::IAM::MaskedIP blacklistedIPv4 = { false, rgw::IAM::Address("11000000101010000000000100000001"), 32 };
const rgw::IAM::MaskedIP blocklistedIPv4 = { false, rgw::IAM::Address("11000000101010000000000100000001"), 32 };
// 2001:db8:85a3:0:0:8a2e:370:7334/128
const rgw::IAM::MaskedIP allowedIPv6 = { true, rgw::IAM::Address("00100000000000010000110110111000100001011010001100000000000000000000000000000000100010100010111000000011011100000111001100110100"), 128 };
// ::1
const rgw::IAM::MaskedIP blacklistedIPv6 = { true, rgw::IAM::Address(1), 128 };
const rgw::IAM::MaskedIP blocklistedIPv6 = { true, rgw::IAM::Address(1), 128 };
// 2001:db8:85a3:0:0:8a2e:370:7330/124
const rgw::IAM::MaskedIP allowedIPv6Range = { true, rgw::IAM::Address("00100000000000010000110110111000100001011010001100000000000000000000000000000000100010100010111000000011011100000111001100110000"), 124 };
public:
Expand All @@ -866,11 +866,11 @@ const string IPPolicyTest::arbitrary_tenant = "arbitrary_tenant";

TEST_F(IPPolicyTest, MaskedIPOperations) {
EXPECT_EQ(stringify(allowedIPv4Range), "192.168.1.0/24");
EXPECT_EQ(stringify(blacklistedIPv4), "192.168.1.1/32");
EXPECT_EQ(stringify(blocklistedIPv4), "192.168.1.1/32");
EXPECT_EQ(stringify(allowedIPv6), "2001:db8:85a3:0:0:8a2e:370:7334/128");
EXPECT_EQ(stringify(allowedIPv6Range), "2001:db8:85a3:0:0:8a2e:370:7330/124");
EXPECT_EQ(stringify(blacklistedIPv6), "0:0:0:0:0:0:0:1/128");
EXPECT_EQ(allowedIPv4Range, blacklistedIPv4);
EXPECT_EQ(stringify(blocklistedIPv6), "0:0:0:0:0:0:0:1/128");
EXPECT_EQ(allowedIPv4Range, blocklistedIPv4);
EXPECT_EQ(allowedIPv6Range, allowedIPv6);
}

Expand All @@ -883,7 +883,7 @@ TEST_F(IPPolicyTest, asNetworkIPv4Range) {
TEST_F(IPPolicyTest, asNetworkIPv4) {
auto actualIPv4 = rgw::IAM::Condition::as_network("192.168.1.1");
ASSERT_TRUE(actualIPv4.is_initialized());
EXPECT_EQ(*actualIPv4, blacklistedIPv4);
EXPECT_EQ(*actualIPv4, blocklistedIPv4);
}

TEST_F(IPPolicyTest, asNetworkIPv6Range) {
Expand Down Expand Up @@ -1016,11 +1016,11 @@ TEST_F(IPPolicyTest, EvalIPAddress) {
auto fullp = Policy(cct.get(), arbitrary_tenant,
bufferlist::static_from_string(ip_address_full_example));
Environment e;
Environment allowedIP, blacklistedIP, allowedIPv6, blacklistedIPv6;
Environment allowedIP, blocklistedIP, allowedIPv6, blocklistedIPv6;
allowedIP["aws:SourceIp"] = "192.168.1.2";
allowedIPv6["aws:SourceIp"] = "::1";
blacklistedIP["aws:SourceIp"] = "192.168.1.1";
blacklistedIPv6["aws:SourceIp"] = "2001:0db8:85a3:0000:0000:8a2e:0370:7334";
blocklistedIP["aws:SourceIp"] = "192.168.1.1";
blocklistedIPv6["aws:SourceIp"] = "2001:0db8:85a3:0000:0000:8a2e:0370:7334";

auto trueacct = FakeIdentity(
Principal::tenant("ACCOUNT-ID-WITHOUT-HYPHENS"));
Expand All @@ -1038,7 +1038,7 @@ TEST_F(IPPolicyTest, EvalIPAddress) {
ARN(Partition::aws, Service::s3,
"", arbitrary_tenant, "example_bucket")),
Effect::Allow);
EXPECT_EQ(allowp.eval(blacklistedIPv6, trueacct, s3ListBucket,
EXPECT_EQ(allowp.eval(blocklistedIPv6, trueacct, s3ListBucket,
ARN(Partition::aws, Service::s3,
"", arbitrary_tenant, "example_bucket")),
Effect::Pass);
Expand All @@ -1053,20 +1053,20 @@ TEST_F(IPPolicyTest, EvalIPAddress) {
"", arbitrary_tenant, "example_bucket/myobject")),
Effect::Deny);

EXPECT_EQ(denyp.eval(blacklistedIP, trueacct, s3ListBucket,
EXPECT_EQ(denyp.eval(blocklistedIP, trueacct, s3ListBucket,
ARN(Partition::aws, Service::s3,
"", arbitrary_tenant, "example_bucket")),
Effect::Pass);
EXPECT_EQ(denyp.eval(blacklistedIP, trueacct, s3ListBucket,
EXPECT_EQ(denyp.eval(blocklistedIP, trueacct, s3ListBucket,
ARN(Partition::aws, Service::s3,
"", arbitrary_tenant, "example_bucket/myobject")),
Effect::Pass);

EXPECT_EQ(denyp.eval(blacklistedIPv6, trueacct, s3ListBucket,
EXPECT_EQ(denyp.eval(blocklistedIPv6, trueacct, s3ListBucket,
ARN(Partition::aws, Service::s3,
"", arbitrary_tenant, "example_bucket")),
Effect::Pass);
EXPECT_EQ(denyp.eval(blacklistedIPv6, trueacct, s3ListBucket,
EXPECT_EQ(denyp.eval(blocklistedIPv6, trueacct, s3ListBucket,
ARN(Partition::aws, Service::s3,
"", arbitrary_tenant, "example_bucket/myobject")),
Effect::Pass);
Expand All @@ -1088,11 +1088,11 @@ TEST_F(IPPolicyTest, EvalIPAddress) {
"", arbitrary_tenant, "example_bucket/myobject")),
Effect::Allow);

EXPECT_EQ(fullp.eval(blacklistedIP, trueacct, s3ListBucket,
EXPECT_EQ(fullp.eval(blocklistedIP, trueacct, s3ListBucket,
ARN(Partition::aws, Service::s3,
"", arbitrary_tenant, "example_bucket")),
Effect::Pass);
EXPECT_EQ(fullp.eval(blacklistedIP, trueacct, s3ListBucket,
EXPECT_EQ(fullp.eval(blocklistedIP, trueacct, s3ListBucket,
ARN(Partition::aws, Service::s3,
"", arbitrary_tenant, "example_bucket/myobject")),
Effect::Pass);
Expand All @@ -1106,11 +1106,11 @@ TEST_F(IPPolicyTest, EvalIPAddress) {
"", arbitrary_tenant, "example_bucket/myobject")),
Effect::Allow);

EXPECT_EQ(fullp.eval(blacklistedIPv6, trueacct, s3ListBucket,
EXPECT_EQ(fullp.eval(blocklistedIPv6, trueacct, s3ListBucket,
ARN(Partition::aws, Service::s3,
"", arbitrary_tenant, "example_bucket")),
Effect::Pass);
EXPECT_EQ(fullp.eval(blacklistedIPv6, trueacct, s3ListBucket,
EXPECT_EQ(fullp.eval(blocklistedIPv6, trueacct, s3ListBucket,
ARN(Partition::aws, Service::s3,
"", arbitrary_tenant, "example_bucket/myobject")),
Effect::Pass);
Expand Down
14 changes: 7 additions & 7 deletions src/test/test_stress_watch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,25 @@ TEST_P(WatchStress, Stress1) {
cluster.ioctx_create(pool_name.c_str(), ioctx);
ASSERT_EQ(0, ioctx.watch("foo", 0, &handle, &ctx));

bool do_blacklist = i % 2;
if (do_blacklist) {
cluster.test_blacklist_self(true);
std::cerr << "blacklisted" << std::endl;
bool do_blocklist = i % 2;
if (do_blocklist) {
cluster.test_blocklist_self(true);
std::cerr << "blocklisted" << std::endl;
sleep(1);
}

bufferlist bl2;
ASSERT_EQ(0, nioctx.notify("foo", 0, bl2));

if (do_blacklist) {
if (do_blocklist) {
sleep(1); // Give a change to see an incorrect notify
} else {
TestAlarm alarm;
sem_wait(sem);
}

if (do_blacklist) {
cluster.test_blacklist_self(false);
if (do_blocklist) {
cluster.test_blocklist_self(false);
}

ioctx.unwatch("foo", handle);
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rbd_mirror/ImageDeleter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ void ImageDeleter<I>::enqueue_failed_delete(DeleteInfoRef* delete_info,
int error_code,
double retry_delay) {
dout(20) << "info=" << *delete_info << ", r=" << error_code << dendl;
if (error_code == -EBLACKLISTED) {
if (error_code == -EBLOCKLISTED) {
std::lock_guard locker{m_lock};
derr << "blacklisted while deleting local image" << dendl;
derr << "blocklisted while deleting local image" << dendl;
complete_active_delete(delete_info, error_code);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rbd_mirror/ImageReplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ class ImageReplayer {
m_finished = finished;
}

inline bool is_blacklisted() const {
inline bool is_blocklisted() const {
std::lock_guard locker{m_lock};
return (m_last_r == -EBLACKLISTED);
return (m_last_r == -EBLOCKLISTED);
}

image_replayer::HealthState get_health_state() const;
Expand Down
10 changes: 5 additions & 5 deletions src/tools/rbd_mirror/InstanceReplayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ InstanceReplayer<I>::~InstanceReplayer() {
}

template <typename I>
bool InstanceReplayer<I>::is_blacklisted() const {
bool InstanceReplayer<I>::is_blocklisted() const {
std::lock_guard locker{m_lock};
return m_blacklisted;
return m_blocklisted;
}

template <typename I>
Expand Down Expand Up @@ -335,10 +335,10 @@ void InstanceReplayer<I>::start_image_replayer(
std::string global_image_id = image_replayer->get_global_image_id();
if (!image_replayer->is_stopped()) {
return;
} else if (image_replayer->is_blacklisted()) {
derr << "global_image_id=" << global_image_id << ": blacklisted detected "
} else if (image_replayer->is_blocklisted()) {
derr << "global_image_id=" << global_image_id << ": blocklisted detected "
<< "during image replay" << dendl;
m_blacklisted = true;
m_blocklisted = true;
return;
} else if (image_replayer->is_finished()) {
// TODO temporary until policy integrated
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rbd_mirror/InstanceReplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class InstanceReplayer {
PoolMetaCache* pool_meta_cache);
~InstanceReplayer();

bool is_blacklisted() const;
bool is_blocklisted() const;

int init();
void shut_down();
Expand Down Expand Up @@ -111,7 +111,7 @@ class InstanceReplayer {
Context *m_image_state_check_task = nullptr;
Context *m_on_shut_down = nullptr;
bool m_manual_stop = false;
bool m_blacklisted = false;
bool m_blocklisted = false;

void wait_for_ops();
void handle_wait_for_ops(int r);
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rbd_mirror/InstanceWatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ InstanceWatcher<I>::InstanceWatcher(librados::IoCtx &io_ctx,
unique_lock_name("rbd::mirror::InstanceWatcher::m_lock", this))),
m_instance_lock(librbd::ManagedLock<I>::create(
m_ioctx, asio_engine, m_oid, this, librbd::managed_lock::EXCLUSIVE, true,
m_cct->_conf.get_val<uint64_t>("rbd_blacklist_expire_seconds"))) {
m_cct->_conf.get_val<uint64_t>("rbd_blocklist_expire_seconds"))) {
}

template <typename I>
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rbd_mirror/Instances.cc
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void Instances<I>::handle_remove_instances(
dout(10) << "r=" << r << ", instance_ids=" << instance_ids << dendl;
ceph_assert(r == 0);

// fire removed notification now that instances have been blacklisted
// fire removed notification now that instances have been blocklisted
m_threads->work_queue->queue(
new C_NotifyInstancesRemoved(this, instance_ids), 0);

Expand Down
12 changes: 6 additions & 6 deletions src/tools/rbd_mirror/LeaderWatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ LeaderWatcher<I>::LeaderWatcher(Threads<I> *threads, librados::IoCtx &io_ctx,
m_instance_id(stringify(m_notifier_id)),
m_leader_lock(new LeaderLock(m_ioctx, *m_threads->asio_engine, m_oid, this,
true, m_cct->_conf.get_val<uint64_t>(
"rbd_blacklist_expire_seconds"))) {
"rbd_blocklist_expire_seconds"))) {
}

template <typename I>
Expand Down Expand Up @@ -250,9 +250,9 @@ void LeaderWatcher<I>::handle_wait_for_tasks() {
}

template <typename I>
bool LeaderWatcher<I>::is_blacklisted() const {
bool LeaderWatcher<I>::is_blocklisted() const {
std::lock_guard locker{m_lock};
return m_blacklisted;
return m_blocklisted;
}

template <typename I>
Expand Down Expand Up @@ -1022,9 +1022,9 @@ template <typename I>
void LeaderWatcher<I>::handle_rewatch_complete(int r) {
dout(5) << "r=" << r << dendl;

if (r == -EBLACKLISTED) {
dout(1) << "blacklisted detected" << dendl;
m_blacklisted = true;
if (r == -EBLOCKLISTED) {
dout(1) << "blocklisted detected" << dendl;
m_blocklisted = true;
return;
}

Expand Down
12 changes: 6 additions & 6 deletions src/tools/rbd_mirror/LeaderWatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class LeaderWatcher : protected librbd::Watcher {
void init(Context *on_finish);
void shut_down(Context *on_finish);

bool is_blacklisted() const;
bool is_blocklisted() const;
bool is_leader() const;
bool is_releasing_leader() const;
bool get_leader_instance_id(std::string *instance_id) const;
Expand Down Expand Up @@ -121,11 +121,11 @@ class LeaderWatcher : protected librbd::Watcher {

LeaderLock(librados::IoCtx& ioctx, librbd::AsioEngine& asio_engine,
const std::string& oid, LeaderWatcher *watcher,
bool blacklist_on_break_lock,
uint32_t blacklist_expire_seconds)
bool blocklist_on_break_lock,
uint32_t blocklist_expire_seconds)
: Parent(ioctx, asio_engine, oid, watcher,
librbd::managed_lock::EXCLUSIVE, blacklist_on_break_lock,
blacklist_expire_seconds),
librbd::managed_lock::EXCLUSIVE, blocklist_on_break_lock,
blocklist_expire_seconds),
watcher(watcher) {
}

Expand Down Expand Up @@ -220,7 +220,7 @@ class LeaderWatcher : protected librbd::Watcher {
Instances<ImageCtxT> *m_instances = nullptr;
librbd::managed_lock::Locker m_locker;

bool m_blacklisted = false;
bool m_blocklisted = false;

AsyncOpTracker m_timer_op_tracker;
Context *m_timer_task = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rbd_mirror/Mirror.cc
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,8 @@ void Mirror::update_pool_replayers(const PoolPeers &pool_peers,
// TODO: make async
pool_replayer->shut_down();
pool_replayer->init(site_name);
} else if (pool_replayer->is_blacklisted()) {
derr << "restarting blacklisted pool replayer for " << peer << dendl;
} else if (pool_replayer->is_blocklisted()) {
derr << "restarting blocklisted pool replayer for " << peer << dendl;
// TODO: make async
pool_replayer->shut_down();
pool_replayer->init(site_name);
Expand Down
10 changes: 5 additions & 5 deletions src/tools/rbd_mirror/NamespaceReplayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ NamespaceReplayer<I>::NamespaceReplayer(
}

template <typename I>
bool NamespaceReplayer<I>::is_blacklisted() const {
bool NamespaceReplayer<I>::is_blocklisted() const {
std::lock_guard locker{m_lock};
return m_instance_replayer->is_blacklisted() ||
return m_instance_replayer->is_blocklisted() ||
(m_local_pool_watcher &&
m_local_pool_watcher->is_blacklisted()) ||
m_local_pool_watcher->is_blocklisted()) ||
(m_remote_pool_watcher &&
m_remote_pool_watcher->is_blacklisted());
m_remote_pool_watcher->is_blocklisted());
}

template <typename I>
Expand Down Expand Up @@ -808,7 +808,7 @@ void NamespaceReplayer<I>::shut_down_image_map(Context *on_finish) {
template <typename I>
void NamespaceReplayer<I>::handle_shut_down_image_map(int r, Context *on_finish) {
dout(5) << "r=" << r << dendl;
if (r < 0 && r != -EBLACKLISTED) {
if (r < 0 && r != -EBLOCKLISTED) {
derr << "failed to shut down image map: " << cpp_strerror(r) << dendl;
}

Expand Down
2 changes: 1 addition & 1 deletion src/tools/rbd_mirror/NamespaceReplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class NamespaceReplayer {
NamespaceReplayer(const NamespaceReplayer&) = delete;
NamespaceReplayer& operator=(const NamespaceReplayer&) = delete;

bool is_blacklisted() const;
bool is_blocklisted() const;

void init(Context *on_finish);
void shut_down(Context *on_finish);
Expand Down
16 changes: 8 additions & 8 deletions src/tools/rbd_mirror/PoolReplayer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ PoolReplayer<I>::~PoolReplayer()
}

template <typename I>
bool PoolReplayer<I>::is_blacklisted() const {
bool PoolReplayer<I>::is_blocklisted() const {
std::lock_guard locker{m_lock};
return m_blacklisted;
return m_blocklisted;
}

template <typename I>
Expand All @@ -272,7 +272,7 @@ void PoolReplayer<I>::init(const std::string& site_name) {

// reset state
m_stopping = false;
m_blacklisted = false;
m_blocklisted = false;
m_site_name = site_name;

dout(10) << "replaying for " << m_peer << dendl;
Expand Down Expand Up @@ -589,15 +589,15 @@ void PoolReplayer<I>::run() {

std::unique_lock locker{m_lock};

if (m_leader_watcher->is_blacklisted() ||
m_default_namespace_replayer->is_blacklisted()) {
m_blacklisted = true;
if (m_leader_watcher->is_blocklisted() ||
m_default_namespace_replayer->is_blocklisted()) {
m_blocklisted = true;
m_stopping = true;
}

for (auto &it : m_namespace_replayers) {
if (it.second->is_blacklisted()) {
m_blacklisted = true;
if (it.second->is_blocklisted()) {
m_blocklisted = true;
m_stopping = true;
break;
}
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rbd_mirror/PoolReplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class PoolReplayer {
PoolReplayer(const PoolReplayer&) = delete;
PoolReplayer& operator=(const PoolReplayer&) = delete;

bool is_blacklisted() const;
bool is_blocklisted() const;
bool is_leader() const;
bool is_running() const;

Expand Down Expand Up @@ -205,7 +205,7 @@ class PoolReplayer {
std::string m_site_name;
bool m_stopping = false;
bool m_manual_stop = false;
bool m_blacklisted = false;
bool m_blocklisted = false;

RadosRef m_local_rados;
RadosRef m_remote_rados;
Expand Down
22 changes: 11 additions & 11 deletions src/tools/rbd_mirror/PoolWatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ PoolWatcher<I>::~PoolWatcher() {
}

template <typename I>
bool PoolWatcher<I>::is_blacklisted() const {
bool PoolWatcher<I>::is_blocklisted() const {
std::lock_guard locker{m_lock};
return m_blacklisted;
return m_blocklisted;
}

template <typename I>
Expand Down Expand Up @@ -170,11 +170,11 @@ void PoolWatcher<I>::handle_register_watcher(int r) {
Context *on_init_finish = nullptr;
if (r >= 0) {
refresh_images();
} else if (r == -EBLACKLISTED) {
dout(0) << "detected client is blacklisted" << dendl;
} else if (r == -EBLOCKLISTED) {
dout(0) << "detected client is blocklisted" << dendl;

std::lock_guard locker{m_lock};
m_blacklisted = true;
m_blocklisted = true;
std::swap(on_init_finish, m_on_init_finish);
} else if (r == -ENOENT) {
dout(5) << "mirroring directory does not exist" << dendl;
Expand Down Expand Up @@ -267,10 +267,10 @@ void PoolWatcher<I>::handle_refresh_images(int r) {
std::swap(on_init_finish, m_on_init_finish);

schedule_listener();
} else if (r == -EBLACKLISTED) {
dout(0) << "detected client is blacklisted during image refresh" << dendl;
} else if (r == -EBLOCKLISTED) {
dout(0) << "detected client is blocklisted during image refresh" << dendl;

m_blacklisted = true;
m_blocklisted = true;
std::swap(on_init_finish, m_on_init_finish);
} else {
retry_refresh = true;
Expand Down Expand Up @@ -315,11 +315,11 @@ template <typename I>
void PoolWatcher<I>::handle_rewatch_complete(int r) {
dout(5) << "r=" << r << dendl;

if (r == -EBLACKLISTED) {
dout(0) << "detected client is blacklisted" << dendl;
if (r == -EBLOCKLISTED) {
dout(0) << "detected client is blocklisted" << dendl;

std::lock_guard locker{m_lock};
m_blacklisted = true;
m_blocklisted = true;
return;
} else if (r == -ENOENT) {
dout(5) << "mirroring directory deleted" << dendl;
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rbd_mirror/PoolWatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class PoolWatcher {
PoolWatcher(const PoolWatcher&) = delete;
PoolWatcher& operator=(const PoolWatcher&) = delete;

bool is_blacklisted() const;
bool is_blocklisted() const;

void init(Context *on_finish = nullptr);
void shut_down(Context *on_finish);
Expand Down Expand Up @@ -127,7 +127,7 @@ class PoolWatcher {
Context *m_timer_ctx = nullptr;

AsyncOpTracker m_async_op_tracker;
bool m_blacklisted = false;
bool m_blocklisted = false;
bool m_shutting_down = false;
bool m_image_ids_invalid = true;
bool m_refresh_in_progress = false;
Expand Down
18 changes: 9 additions & 9 deletions src/tools/rbd_mirror/image_deleter/TrashWatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void TrashWatcher<I>::handle_rewatch_complete(int r) {
dout(5) << "r=" << r << dendl;

if (r == -EBLACKLISTED) {
dout(0) << "detected client is blacklisted" << dendl;
dout(0) << "detected client is blocklisted" << dendl;
return;
} else if (r == -ENOENT) {
dout(5) << "trash directory deleted" << dendl;
Expand Down Expand Up @@ -135,9 +135,9 @@ void TrashWatcher<I>::handle_create_trash(int r) {
}

Context* on_init_finish = nullptr;
if (r == -EBLACKLISTED || r == -ENOENT) {
if (r == -EBLACKLISTED) {
dout(0) << "detected client is blacklisted" << dendl;
if (r == -EBLOCKLISTED || r == -ENOENT) {
if (r == -EBLOCKLISTED) {
dout(0) << "detected client is blocklisted" << dendl;
} else {
dout(0) << "detected pool no longer exists" << dendl;
}
Expand Down Expand Up @@ -201,8 +201,8 @@ void TrashWatcher<I>::handle_register_watcher(int r) {
Context *on_init_finish = nullptr;
if (r >= 0) {
trash_list(true);
} else if (r == -EBLACKLISTED) {
dout(0) << "detected client is blacklisted" << dendl;
} else if (r == -EBLOCKLISTED) {
dout(0) << "detected client is blocklisted" << dendl;

std::lock_guard locker{m_lock};
std::swap(on_init_finish, m_on_init_finish);
Expand Down Expand Up @@ -287,8 +287,8 @@ void TrashWatcher<I>::handle_trash_list(int r) {
r = 0;
}

if (r == -EBLACKLISTED) {
dout(0) << "detected client is blacklisted during trash refresh" << dendl;
if (r == -EBLOCKLISTED) {
dout(0) << "detected client is blocklisted during trash refresh" << dendl;
m_trash_list_in_progress = false;
std::swap(on_init_finish, m_on_init_finish);
} else if (r >= 0 && images.size() < MAX_RETURN) {
Expand All @@ -303,7 +303,7 @@ void TrashWatcher<I>::handle_trash_list(int r) {
m_last_image_id = images.rbegin()->first;
trash_list(false);
return;
} else if (r < 0 && r != -EBLACKLISTED) {
} else if (r < 0 && r != -EBLOCKLISTED) {
derr << "failed to retrieve trash directory: " << cpp_strerror(r) << dendl;
schedule_trash_list(10);
}
Expand Down