From: Jason Dillaman Date: Tue, 10 Mar 2020 23:18:04 +0000 (-0400) Subject: librbd: peer removal needs to open non-primary images in R/W mode X-Git-Tag: v15.1.1~31^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9b2dc5a267e45be2397a915ab9a7ddce914ba3fa;p=ceph.git librbd: peer removal needs to open non-primary images in R/W mode The non-primary image might have mirror snapshots that need to be updated to remove the peer reference. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/api/Mirror.cc b/src/librbd/api/Mirror.cc index ebdaa4926cba..304611dd9e01 100644 --- a/src/librbd/api/Mirror.cc +++ b/src/librbd/api/Mirror.cc @@ -1544,6 +1544,8 @@ int Mirror::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;