]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
*: convert EBLACKLISTED to EBLOCKLISTED
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 13 Aug 2020 20:16:43 +0000 (13:16 -0700)
committerNeha Ojha <nojha@redhat.com>
Mon, 24 Aug 2020 19:53:08 +0000 (19:53 +0000)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
23 files changed:
qa/tasks/cephfs/test_volume_client.py
src/journal/JournalMetadata.cc
src/librbd/Operations.cc
src/librbd/cache/ObjectCacherObjectDispatch.cc
src/librbd/exclusive_lock/PreReleaseRequest.cc
src/librbd/watcher/RewatchRequest.cc
src/mds/MDLog.cc
src/mds/MDSContext.cc
src/mds/MDSRank.cc
src/mds/MDSTable.cc
src/mds/PurgeQueue.cc
src/mds/RecoveryQueue.cc
src/test/librbd/deep_copy/test_mock_ObjectCopyRequest.cc
src/test/librbd/exclusive_lock/test_mock_PreReleaseRequest.cc
src/test/librbd/image/test_mock_RefreshRequest.cc
src/test/librbd/io/test_mock_ObjectRequest.cc
src/test/librbd/test_mock_Watcher.cc
src/test/librbd/watcher/test_mock_RewatchRequest.cc
src/test/rbd_mirror/image_deleter/test_mock_TrashWatcher.cc
src/test/rbd_mirror/image_map/test_Policy.cc
src/test/rbd_mirror/test_mock_ImageMap.cc
src/test/rbd_mirror/test_mock_PoolWatcher.cc
src/tools/rbd_mirror/image_deleter/TrashWatcher.cc

index b7fd51dac47d1ff11be89d1fb415a9d5f8898adb..e86f1dfa6fa1b164758872e884d054828a924a1e 100644 (file)
@@ -271,7 +271,7 @@ vc.disconnect()
             try:
                 background.wait()
             except CommandFailedError:
-                # command failed with EBLACKLISTED?
+                # command failed with EBLOCKLISTED?
                 if "transport endpoint shutdown" in background.stderr.getvalue():
                     pass
                 else:
index b03c851789f27d63af5d01663e9c54cf13281c2e..4e5b71c4608d729cb7b8888ce4223960f5b2f537 100644 (file)
@@ -882,7 +882,7 @@ void JournalMetadata::handle_watch_reset() {
   if (r < 0) {
     if (r == -ENOENT) {
       ldout(m_cct, 5) << __func__ << ": journal header not found" << dendl;
-    } else if (r == -EBLACKLISTED) {
+    } else if (r == -EBLOCKLISTED) {
       ldout(m_cct, 5) << __func__ << ": client blocklisted" << dendl;
     } else {
       lderr(m_cct) << __func__ << ": failed to watch journal: "
index 7342b4d2d64fd0b501d4c8e9751beea66e20f989..c18259c67f78ac6b542b2797cebeaf04f45c3129 100644 (file)
@@ -234,7 +234,7 @@ struct C_InvokeAsyncRequest : public Context {
     ldout(cct, 20) << __func__ << ": r=" << r << dendl;
 
     if (r < 0) {
-      complete(r == -EBLACKLISTED ? -EBLACKLISTED : -EROFS);
+      complete(r == -EBLOCKLISTED ? -EBLOCKLISTED : -EROFS);
       return;
     }
 
index 6dfec339368b81e8a1b5a5d9c86a46c3f586fd38..0c0be29a91d93eb484fe9117d8f7d1d23ca15ec3 100644 (file)
@@ -48,7 +48,7 @@ struct ObjectCacherObjectDispatch<I>::C_InvalidateCache : public Context {
     ceph_assert(ceph_mutex_is_locked(dispatcher->m_cache_lock));
     auto cct = dispatcher->m_image_ctx->cct;
 
-    if (r == -EBLACKLISTED) {
+    if (r == -EBLOCKLISTED) {
       lderr(cct) << "blocklisted during flush (purging)" << dendl;
       dispatcher->m_object_cacher->purge_set(dispatcher->m_object_set);
     } else if (r < 0 && purge_on_error) {
index 11d4806de553ac98737c645510893d90f8242c95..fe1e08fe74b160a153e683dfeae599f6b338ca24 100644 (file)
@@ -127,7 +127,7 @@ void PreReleaseRequest<I>::handle_block_writes(int r) {
   CephContext *cct = m_image_ctx.cct;
   ldout(cct, 10) << "r=" << r << dendl;
 
-  if (r == -EBLACKLISTED) {
+  if (r == -EBLOCKLISTED) {
     // allow clean shut down if blocklisted
     lderr(cct) << "failed to block writes because client is blocklisted"
                << dendl;
index 55d9133641abe481db7f9eac71129658fed185aa..b890cb3c5034d7e27f59beee64d0ca12216704c4 100644 (file)
@@ -57,7 +57,7 @@ void RewatchRequest::handle_unwatch(int r) {
   CephContext *cct = reinterpret_cast<CephContext *>(m_ioctx.cct());
   ldout(cct, 10) << "r=" << r << dendl;
 
-  if (r == -EBLACKLISTED) {
+  if (r == -EBLOCKLISTED) {
     lderr(cct) << "client blocklisted" << dendl;
     finish(r);
     return;
index acc55a26455700fa96d79d47d3cbaf31289bdddb..4b1e32bed885aa1fb4d79e66b17201243190f783 100644 (file)
@@ -97,7 +97,7 @@ class C_MDL_WriteError : public MDSIOContextBase {
     MDSRank *mds = get_mds();
     // assume journal is reliable, so don't choose action based on
     // g_conf()->mds_action_on_write_error.
-    if (r == -EBLACKLISTED) {
+    if (r == -EBLOCKLISTED) {
       derr << "we have been blocklisted (fenced), respawning..." << dendl;
       mds->respawn();
     } else {
index 447ef823553226684f1e29d48c06ce0de714907b..c702d0253f74fbf89296bd11c1ed2d6e2628506c 100644 (file)
@@ -107,7 +107,7 @@ void MDSIOContextBase::complete(int r) {
     return;
   }
 
-  if (r == -EBLACKLISTED) {
+  if (r == -EBLOCKLISTED) {
     derr << "MDSIOContextBase: blocklisted!  Restarting..." << dendl;
     mds->respawn();
   } else {
index d1376dbe1d4a95666519b5f66a6fb57aea3cd9ba..d2a301a5bd4860f89dbfb4c1d9fa84f097e343d8 100644 (file)
@@ -949,7 +949,7 @@ void MDSRank::damaged_unlocked()
 
 void MDSRank::handle_write_error(int err)
 {
-  if (err == -EBLACKLISTED) {
+  if (err == -EBLOCKLISTED) {
     derr << "we have been blocklisted (fenced), respawning..." << dendl;
     respawn();
     return;
index b0809f50e41d9d622afeb6da3f89c6e4b98df718..4d463186ac014d9a55a528375e3c6bb09275cbf9 100644 (file)
@@ -168,7 +168,7 @@ void MDSTable::load_2(int r, bufferlist& bl, Context *onfinish)
 {
   ceph_assert(is_opening());
   state = STATE_ACTIVE;
-  if (r == -EBLACKLISTED) {
+  if (r == -EBLOCKLISTED) {
     mds->respawn();
     return;
   }
index bdb81166f462de872ee7724a50638fa9c6af89a9..7038d693007fc725cd567054df3a2d163a33a636 100644 (file)
@@ -595,7 +595,7 @@ void PurgeQueue::_execute_item(
                       new LambdaContext([this, expire_to](int r){
     std::lock_guard l(lock);
 
-    if (r == -EBLACKLISTED) {
+    if (r == -EBLOCKLISTED) {
       finisher.queue(on_error, r);
       on_error = nullptr;
       return;
index 1abc6a2530a97abc0cb6a690cd7767d7dd127115..18adeb281b4738ab2c5a4999bd941daf7b5b94ee 100644 (file)
@@ -188,7 +188,7 @@ void RecoveryQueue::_recovered(CInode *in, int r, uint64_t size, utime_t mtime)
 
   if (r != 0) {
     dout(0) << "recovery error! " << r << dendl;
-    if (r == -EBLACKLISTED) {
+    if (r == -EBLOCKLISTED) {
       mds->respawn();
       return;
     } else {
index 3c6db9057d222dba0d905e0d655165200dc96440..48b732706fb2e1ab71b33eb2966d057a847c208f 100644 (file)
@@ -940,10 +940,10 @@ TEST_F(TestMockDeepCopyObjectCopyRequest, ObjectMapUpdateError) {
   expect_write(mock_dst_io_ctx, 0, one.range_end(), {0, {}}, 0);
   expect_start_op(mock_exclusive_lock);
   expect_update_object_map(mock_dst_image_ctx, mock_object_map,
-                           m_dst_snap_ids[0], OBJECT_EXISTS, -EBLACKLISTED);
+                           m_dst_snap_ids[0], OBJECT_EXISTS, -EBLOCKLISTED);
 
   request->send();
-  ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+  ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
 }
 
 TEST_F(TestMockDeepCopyObjectCopyRequest, WriteSnapsStart) {
index d56ee1155f62586423e17c3f73b57a1e31d9e11a..b30b1a3b6c5444c3d17af80b1085e66987037c8f 100644 (file)
@@ -303,20 +303,20 @@ TEST_F(TestMockExclusiveLockPreReleaseRequest, Blacklisted) {
   expect_prepare_lock(mock_image_ctx);
   expect_cancel_op_requests(mock_image_ctx, 0);
   MockImageDispatch mock_image_dispatch;
-  expect_set_require_lock(mock_image_ctx, mock_image_dispatch, -EBLACKLISTED);
+  expect_set_require_lock(mock_image_ctx, mock_image_dispatch, -EBLOCKLISTED);
 
   cache::MockImageCache mock_image_cache;
   mock_image_ctx.image_cache = &mock_image_cache;
   MockShutdownRequest mock_shutdown_request;
   expect_close_image_cache(mock_image_ctx, mock_shutdown_request, 0);
 
-  expect_invalidate_cache(mock_image_ctx, -EBLACKLISTED);
+  expect_invalidate_cache(mock_image_ctx, -EBLOCKLISTED);
 
   expect_flush_notifies(mock_image_ctx);
 
   MockJournal mock_journal;
   mock_image_ctx.journal = &mock_journal;
-  expect_close_journal(mock_image_ctx, mock_journal, -EBLACKLISTED);
+  expect_close_journal(mock_image_ctx, mock_journal, -EBLOCKLISTED);
 
   MockObjectMap mock_object_map;
   mock_image_ctx.object_map = &mock_object_map;
index c032cb7f79161dc79de8b385bfcb51f8e7b401b8..9a31eb91a32ef340b0aedee44c6f327efa8425f7 100644 (file)
@@ -1445,7 +1445,7 @@ TEST_F(TestMockImageRefreshRequest, OpenObjectMapError) {
   expect_apply_metadata(mock_image_ctx, 0);
   expect_get_group(mock_image_ctx, 0);
   expect_refresh_parent_is_required(mock_refresh_parent_request, false);
-  expect_open_object_map(mock_image_ctx, &mock_object_map, -EBLACKLISTED);
+  expect_open_object_map(mock_image_ctx, &mock_object_map, -EBLOCKLISTED);
   EXPECT_CALL(mock_image_ctx, rebuild_data_io_context());
 
   C_SaferCond ctx;
@@ -1453,7 +1453,7 @@ TEST_F(TestMockImageRefreshRequest, OpenObjectMapError) {
                                                    &ctx);
   req->send();
 
-  ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+  ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
   ASSERT_EQ(nullptr, mock_image_ctx.object_map);
 }
 
index 0803ec32d8d31ca6fde3793b33c6b6d8dc4c15b9..abe300941053e195888747e3339d4c3908148acf 100644 (file)
@@ -1566,14 +1566,14 @@ TEST_F(TestMockIoObjectRequest, ObjectMapError) {
   expect_get_parent_overlap(mock_image_ctx, CEPH_NOSNAP, 0, 0);
   expect_object_may_exist(mock_image_ctx, 0, true);
   expect_object_map_update(mock_image_ctx, 0, 1, OBJECT_EXISTS, {}, true,
-                           -EBLACKLISTED);
+                           -EBLOCKLISTED);
 
   C_SaferCond ctx;
   auto req = MockObjectWriteRequest::create_write(
     &mock_image_ctx, 0, 0, std::move(bl), mock_image_ctx.snapc, 0, 0,
     std::nullopt, {}, &ctx);
   req->send();
-  ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+  ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
 }
 
 } // namespace io
index 7b470d546c7ec6a3e8a19f0c32bd2f7b86fa0a7e..8aa746b71632ce27a2ae32d34bf753e5ef1f0549 100644 (file)
@@ -291,7 +291,7 @@ TEST_F(TestMockWatcher, ReregisterWatchBlacklist) {
   InSequence seq;
   expect_aio_watch(mock_image_ctx, 0);
   expect_aio_unwatch(mock_image_ctx, 0);
-  expect_aio_watch(mock_image_ctx, -EBLACKLISTED);
+  expect_aio_watch(mock_image_ctx, -EBLOCKLISTED);
 
   C_SaferCond register_ctx;
   mock_image_watcher.register_watch(&register_ctx);
@@ -299,7 +299,7 @@ TEST_F(TestMockWatcher, ReregisterWatchBlacklist) {
   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);
 
   // wait for recovery unwatch/watch
   ASSERT_TRUE(wait_for_watch(mock_image_ctx, 2));
index 5d3380954d9d4765f157b5054cadc0bef45983d0..77f6cb8ee3d46c9ef1f81ffcc74aa3a9f05df848 100644 (file)
@@ -129,7 +129,7 @@ TEST_F(TestMockWatcherRewatchRequest, WatchBlacklist) {
 
   InSequence seq;
   expect_aio_unwatch(mock_image_ctx, 0);
-  expect_aio_watch(mock_image_ctx, -EBLACKLISTED);
+  expect_aio_watch(mock_image_ctx, -EBLOCKLISTED);
 
   C_SaferCond ctx;
   MockRewatchRequest *req = MockRewatchRequest::create(mock_image_ctx.md_ctx,
@@ -142,7 +142,7 @@ TEST_F(TestMockWatcherRewatchRequest, WatchBlacklist) {
     std::unique_lock watch_locker{m_watch_lock};
     req->send();
   }
-  ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+  ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
   ASSERT_EQ(0U, m_watch_handle);
 }
 
index bd434b85f511ff10a8d8cd6ef8e4dd5e396f64da..017923c76a04a6495ffd0de7ad0ac52be3909798 100644 (file)
@@ -297,14 +297,14 @@ TEST_F(TestMockImageDeleterTrashWatcher, CreateBlacklist) {
   expect_work_queue(mock_threads);
 
   InSequence seq;
-  expect_create_trash(m_local_io_ctx, -EBLACKLISTED);
+  expect_create_trash(m_local_io_ctx, -EBLOCKLISTED);
 
   MockListener mock_listener;
   MockTrashWatcher mock_trash_watcher(m_local_io_ctx, &mock_threads,
                                       mock_listener);
   C_SaferCond ctx;
   mock_trash_watcher.init(&ctx);
-  ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+  ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
 
   MockLibrbdTrashWatcher mock_librbd_trash_watcher;
   expect_trash_watcher_unregister(mock_librbd_trash_watcher, 0);
@@ -364,14 +364,14 @@ TEST_F(TestMockImageDeleterTrashWatcher, RegisterWatcherBlacklist) {
 
   MockLibrbdTrashWatcher mock_librbd_trash_watcher;
   expect_trash_watcher_is_unregistered(mock_librbd_trash_watcher, true);
-  expect_trash_watcher_register(mock_librbd_trash_watcher, -EBLACKLISTED);
+  expect_trash_watcher_register(mock_librbd_trash_watcher, -EBLOCKLISTED);
 
   MockListener mock_listener;
   MockTrashWatcher mock_trash_watcher(m_local_io_ctx, &mock_threads,
                                       mock_listener);
   C_SaferCond ctx;
   mock_trash_watcher.init(&ctx);
-  ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+  ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
 
   expect_trash_watcher_unregister(mock_librbd_trash_watcher, 0);
   ASSERT_EQ(0, when_shut_down(mock_trash_watcher));
@@ -415,14 +415,14 @@ TEST_F(TestMockImageDeleterTrashWatcher, TrashListBlacklist) {
   MockLibrbdTrashWatcher mock_librbd_trash_watcher;
   expect_trash_watcher_is_unregistered(mock_librbd_trash_watcher, true);
   expect_trash_watcher_register(mock_librbd_trash_watcher, 0);
-  expect_trash_list(m_local_io_ctx, "", {}, -EBLACKLISTED);
+  expect_trash_list(m_local_io_ctx, "", {}, -EBLOCKLISTED);
 
   MockListener mock_listener;
   MockTrashWatcher mock_trash_watcher(m_local_io_ctx, &mock_threads,
                                       mock_listener);
   C_SaferCond ctx;
   mock_trash_watcher.init(&ctx);
-  ASSERT_EQ(-EBLACKLISTED, ctx.wait());
+  ASSERT_EQ(-EBLOCKLISTED, ctx.wait());
 
   expect_trash_watcher_unregister(mock_librbd_trash_watcher, 0);
   ASSERT_EQ(0, when_shut_down(mock_trash_watcher));
@@ -507,7 +507,7 @@ TEST_F(TestMockImageDeleterTrashWatcher, RewatchBlacklist) {
   mock_trash_watcher.init(&ctx);
   ASSERT_EQ(0, ctx.wait());
 
-  LibrbdTrashWatcher::get_instance().handle_rewatch_complete(-EBLACKLISTED);
+  LibrbdTrashWatcher::get_instance().handle_rewatch_complete(-EBLOCKLISTED);
   m_threads->work_queue->drain();
 
   expect_trash_watcher_unregister(mock_librbd_trash_watcher, 0);
index 4535ab7a59e28e5c8b8e8e93bacde4542ccd6ff5..5f8bdd17fbe1db39354551597b56610562ec1318 100644 (file)
@@ -223,7 +223,7 @@ TEST_F(TestImageMapPolicy, MapFailureAndUnmap) {
                              &shuffle_global_image_ids);
   ASSERT_TRUE(shuffle_global_image_ids.empty());
 
-  ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLACKLISTED));
+  ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLOCKLISTED));
 
   ASSERT_EQ(ACTION_TYPE_RELEASE, m_policy->start_action(global_image_id));
   ASSERT_TRUE(m_policy->finish_action(global_image_id, -ENOENT));
@@ -278,7 +278,7 @@ TEST_F(TestImageMapPolicy, ReshuffleWithMapFailure) {
   m_policy->remove_instances({"9876"}, &shuffle_global_image_ids);
   ASSERT_TRUE(shuffle_global_image_ids.empty());
 
-  ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLACKLISTED));
+  ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLOCKLISTED));
 
   ASSERT_EQ(ACTION_TYPE_RELEASE, m_policy->start_action(global_image_id));
   ASSERT_TRUE(m_policy->finish_action(global_image_id, 0));
@@ -325,7 +325,7 @@ TEST_F(TestImageMapPolicy, ShuffleFailureAndRemove) {
   m_policy->remove_instances({"9876"}, &shuffle_global_image_ids);
   ASSERT_TRUE(shuffle_global_image_ids.empty());
 
-  ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLACKLISTED));
+  ASSERT_TRUE(m_policy->finish_action(global_image_id, -EBLOCKLISTED));
 
   ASSERT_EQ(ACTION_TYPE_RELEASE, m_policy->start_action(global_image_id));
   ASSERT_TRUE(m_policy->finish_action(global_image_id, 0));
index 3b4927bba7c3b966a72667623a9e8c225d413949..ac4ddb7923a4643729ed8465707614201d8ecee6 100644 (file)
@@ -1226,7 +1226,7 @@ TEST_F(TestMockImageMap, RemoveInstanceWithRemoveImage) {
   remote_peer_ack_nowait(mock_image_map.get(), shuffled_global_image_ids,
                          -ENOENT, &peer_ack_remove_ctxs);
   remote_peer_ack_wait(mock_image_map.get(), shuffled_global_image_ids,
-                       -EBLACKLISTED, &peer_ack_ctxs);
+                       -EBLOCKLISTED, &peer_ack_ctxs);
 
   wait_for_scheduled_task();
   ASSERT_EQ(0, when_shut_down(mock_image_map.get()));
index 317b2756395de441cd416a9467bdb24ed1fcb8e9..bac80599fade89881c68c8366e25f1908e791bf1 100644 (file)
@@ -435,14 +435,14 @@ TEST_F(TestMockPoolWatcher, RegisterWatcherBlacklist) {
   InSequence seq;
   MockMirroringWatcher mock_mirroring_watcher;
   expect_mirroring_watcher_is_unregistered(mock_mirroring_watcher, true);
-  expect_mirroring_watcher_register(mock_mirroring_watcher, -EBLACKLISTED);
+  expect_mirroring_watcher_register(mock_mirroring_watcher, -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_EQ(-EBLOCKLISTED, ctx.wait());
   ASSERT_TRUE(mock_pool_watcher.is_blocklisted());
 
   expect_mirroring_watcher_unregister(mock_mirroring_watcher, 0);
index beb64b66c9f79d325098ca7dd80656629e2efc4e..552d77e0e9f7176fe6623ab31917074eea54bc20 100644 (file)
@@ -95,7 +95,7 @@ template <typename I>
 void TrashWatcher<I>::handle_rewatch_complete(int r) {
   dout(5) << "r=" << r << dendl;
 
-  if (r == -EBLACKLISTED) {
+  if (r == -EBLOCKLISTED) {
     dout(0) << "detected client is blocklisted" << dendl;
     return;
   } else if (r == -ENOENT) {