summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorN Balachandran <nibalach@redhat.com>2024-08-22 10:15:36 +0200
committerN Balachandran <nibalach@redhat.com>2024-08-27 07:56:38 +0200
commit2346cd912ee2c5aefe5b203cc872e0528fc96a49 (patch)
tree84e0c2daf443813941c6532eb906d77d877bdecc /src/tools
parentMerge pull request #59348 from zdover23/wip-doc-2024-08-20-rados-ops-cache-ti... (diff)
downloadceph-2346cd912ee2c5aefe5b203cc872e0528fc96a49.tar.xz
ceph-2346cd912ee2c5aefe5b203cc872e0528fc96a49.zip
rbd-mirror: use correct ioctx for namespace
The PoolReplayer uses the ioctx for the default namespace to check if other namespaces are enabled for mirroring, causing it to incorrectly conclude that they are all enabled. Fixes: https://tracker.ceph.com/issues/67676 Signed-off-by: N Balachandran <nibalach@redhat.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/rbd_mirror/PoolReplayer.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tools/rbd_mirror/PoolReplayer.cc b/src/tools/rbd_mirror/PoolReplayer.cc
index cb88e6e96f7..dcbedc67e42 100644
--- a/src/tools/rbd_mirror/PoolReplayer.cc
+++ b/src/tools/rbd_mirror/PoolReplayer.cc
@@ -747,8 +747,12 @@ int PoolReplayer<I>::list_mirroring_namespaces(
}
for (auto &name : names) {
+ librados::IoCtx ns_ioctx;
+ ns_ioctx.dup(m_local_io_ctx);
+ ns_ioctx.set_namespace(name);
+
cls::rbd::MirrorMode mirror_mode = cls::rbd::MIRROR_MODE_DISABLED;
- int r = librbd::cls_client::mirror_mode_get(&m_local_io_ctx, &mirror_mode);
+ int r = librbd::cls_client::mirror_mode_get(&ns_ioctx, &mirror_mode);
if (r < 0 && r != -ENOENT) {
derr << "failed to get namespace mirror mode: " << cpp_strerror(r)
<< dendl;