diff options
author | N Balachandran <nibalach@redhat.com> | 2024-08-22 10:15:36 +0200 |
---|---|---|
committer | N Balachandran <nibalach@redhat.com> | 2024-08-27 07:56:38 +0200 |
commit | 2346cd912ee2c5aefe5b203cc872e0528fc96a49 (patch) | |
tree | 84e0c2daf443813941c6532eb906d77d877bdecc /src/tools | |
parent | Merge pull request #59348 from zdover23/wip-doc-2024-08-20-rados-ops-cache-ti... (diff) | |
download | ceph-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.cc | 6 |
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; |