]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: ignore permission errors on rbd_mirroring object 21225/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 11 Jul 2017 17:42:35 +0000 (13:42 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 3 Apr 2018 21:59:31 +0000 (17:59 -0400)
Fixes: http://tracker.ceph.com/issues/20571
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 6c2d896ea2cee515f0fecec41adbec1e7d6dee23)

Conflicts:
src/tools/rbd_mirror/ClusterWatcher.cc: trivial resolution

src/tools/rbd_mirror/ClusterWatcher.cc

index 0aaba1fa5f237ae579e6c41d4611a30a59275680..81aa9401955cc809d78b3414cb42d59138d75d3c 100644 (file)
@@ -1,13 +1,12 @@
 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
 // vim: ts=8 sw=2 smarttab
 
+#include "ClusterWatcher.h"
 #include "common/debug.h"
 #include "common/errno.h"
-
+#include "cls/rbd/cls_rbd_client.h"
 #include "librbd/internal.h"
 
-#include "ClusterWatcher.h"
-
 #define dout_subsys ceph_subsys_rbd_mirror
 #undef dout_prefix
 #define dout_prefix *_dout << "rbd::mirror::ClusterWatcher:" << this << " " \
@@ -102,14 +101,17 @@ void ClusterWatcher::read_pool_peers(PoolPeers *pool_peers,
       continue;
     }
 
-    rbd_mirror_mode_t mirror_mode;
-    r = librbd::mirror_mode_get(ioctx, &mirror_mode);
-    if (r < 0) {
+    cls::rbd::MirrorMode mirror_mode_internal;
+    r = librbd::cls_client::mirror_mode_get(&ioctx, &mirror_mode_internal);
+    if (r == -EPERM) {
+      dout(10) << "access denied querying pool " << pool_name << dendl;
+      continue;
+    } else if (r < 0) {
       derr << "could not tell whether mirroring was enabled for " << pool_name
           << " : " << cpp_strerror(r) << dendl;
       continue;
     }
-    if (mirror_mode == RBD_MIRROR_MODE_DISABLED) {
+    if (mirror_mode_internal == cls::rbd::MIRROR_MODE_DISABLED) {
       dout(10) << "mirroring is disabled for pool " << pool_name << dendl;
       continue;
     }