From 3084cf32463a07cecec66befa1562a187bc1734f Mon Sep 17 00:00:00 2001 From: Yuan Zhou Date: Mon, 16 May 2016 16:18:59 +0800 Subject: [PATCH] rbd: close journal before removing Otherwise there is some unwanted error message. Fixes: http://tracker.ceph.com/issues/15863 Signed-off-by: Yuan Zhou (cherry picked from commit ecdad4acca635d4b9f0b407889dde9985ab3a506) --- src/librbd/internal.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 2445bdacd3ba..a392b3933df5 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -1817,6 +1817,15 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force, } } + C_SaferCond cond; + ictx->journal->close(&cond); + r = cond.wait(); + if (r < 0) { + lderr(cct) << "error closing image journal: " << cpp_strerror(r) + << dendl; + return r; + } + r = Journal<>::remove(ictx->md_ctx, ictx->id); if (r < 0) { lderr(cct) << "error removing image journal: " << cpp_strerror(r) -- 2.47.3