From: Jason Dillaman Date: Thu, 17 Sep 2020 17:05:27 +0000 (-0400) Subject: librbd: update refresh image dispatch layer flush exclusions X-Git-Tag: v17.0.0~1064^2~8 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=2122542a2e1bed563f633e52ac272f0ccb5a236a;p=ceph.git librbd: update refresh image dispatch layer flush exclusions Only flush requests coming from the refresh state machine or from the exclusive-lock dispatch layer initializationshould be ignored. This is because both can be initiated from the refresh state machine and therefore deadlock. Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/io/RefreshImageDispatch.cc b/src/librbd/io/RefreshImageDispatch.cc index 4632660ad8382..24a2038ca7ece 100644 --- a/src/librbd/io/RefreshImageDispatch.cc +++ b/src/librbd/io/RefreshImageDispatch.cc @@ -122,7 +122,11 @@ bool RefreshImageDispatch::flush( auto cct = m_image_ctx->cct; ldout(cct, 20) << "tid=" << tid << dendl; - if (flush_source != FLUSH_SOURCE_USER) { + // The refresh state machine can initiate a flush and it can + // enable the exclusive-lock which will also attmept to flush. + if (flush_source == FLUSH_SOURCE_REFRESH || + flush_source == FLUSH_SOURCE_EXCLUSIVE_LOCK_SKIP_REFRESH || + flush_source == FLUSH_SOURCE_SHUTDOWN) { return false; }