From: Mykola Golub Date: Thu, 10 Nov 2016 13:35:59 +0000 (+0200) Subject: librbd: restore journal access when force disabling mirroring X-Git-Tag: v10.2.6~36^2~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6b8361f23124d41873f24b61e25a1f1d23c9ee1b;p=ceph.git librbd: restore journal access when force disabling mirroring If mirroring is force disabled on a demoted image, the journal was being left in an inconsistent ownership state. This is a direct commit to jewel as the fix in the master was against the newly added async version of mirror disable, which is not going to be merged to jewel. Fixes: http://tracker.ceph.com/issues/17767 Signed-off-by: Mykola Golub --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 073be350d55c..68d195be5e2f 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -339,6 +339,13 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force, << dendl; } + if (!is_primary) { + r = Journal<>::promote(ictx); + if (r < 0) { + lderr(cct) << "failed to promote image: " << cpp_strerror(r) << dendl; + } + } + header_oid = ::journal::Journaler::header_oid(ictx->id); while(true) {