From: Ilya Dryomov Date: Mon, 8 Feb 2021 16:01:47 +0000 (+0100) Subject: librbd: don't hold owner_lock for validate_image_removal() X-Git-Tag: v15.2.13~2^2~10^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4844525055198b5728c7ca69b56869bd7737795d;p=ceph.git librbd: don't hold owner_lock for validate_image_removal() handle_exclusive_lock() and handle_shut_down_exclusive_lock() call validate_image_removal() without owner_lock held, so holding it in shut_down_exclusive_lock() appears to be redundant. Signed-off-by: Ilya Dryomov (cherry picked from commit b1bf3eaef200fb5d1aa847cad14936f2bbbf7b64) --- diff --git a/src/librbd/image/PreRemoveRequest.cc b/src/librbd/image/PreRemoveRequest.cc index 3ad92616af000..fa4141834b186 100644 --- a/src/librbd/image/PreRemoveRequest.cc +++ b/src/librbd/image/PreRemoveRequest.cc @@ -117,8 +117,9 @@ void PreRemoveRequest::handle_exclusive_lock(int r) { template void PreRemoveRequest::shut_down_exclusive_lock() { - std::shared_lock owner_lock{m_image_ctx->owner_lock}; + std::shared_lock owner_locker{m_image_ctx->owner_lock}; if (m_image_ctx->exclusive_lock == nullptr) { + owner_locker.unlock(); validate_image_removal(); return; }