]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: peer removal needs to open non-primary images in R/W mode
authorJason Dillaman <dillaman@redhat.com>
Tue, 10 Mar 2020 23:18:04 +0000 (19:18 -0400)
committerJason Dillaman <dillaman@redhat.com>
Tue, 10 Mar 2020 23:23:02 +0000 (19:23 -0400)
The non-primary image might have mirror snapshots that need to be
updated to remove the peer reference.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/api/Mirror.cc

index ebdaa4926cbac62b9b9c0662f258cd42fe57f4b2..304611dd9e01f11be705930e1fa35ac212522be9 100644 (file)
@@ -1544,6 +1544,8 @@ int Mirror<I>::peer_site_remove(librados::IoCtx& io_ctx,
       // TODO: optimize.
 
       I *img_ctx = I::create("", image_id, nullptr, ns_io_ctx, false);
+      img_ctx->read_only_mask &= ~IMAGE_READ_ONLY_FLAG_NON_PRIMARY;
+
       r = img_ctx->state->open(0);
       if (r == -ENOENT) {
         continue;