]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: restore journal access when force disabling mirroring 11916/head
authorMykola Golub <mgolub@mirantis.com>
Thu, 10 Nov 2016 13:35:59 +0000 (15:35 +0200)
committerMykola Golub <mgolub@mirantis.com>
Fri, 11 Nov 2016 20:04:10 +0000 (22:04 +0200)
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 <mgolub@mirantis.com>
src/librbd/internal.cc

index 073be350d55c98791fdb7418bc63ccfc0cf1d08c..68d195be5e2f7f539b3c9616bd9c18fcad5138b2 100644 (file)
@@ -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) {