]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: don't hold owner_lock for validate_image_removal()
authorIlya Dryomov <idryomov@gmail.com>
Mon, 8 Feb 2021 16:01:47 +0000 (17:01 +0100)
committerJason Dillaman <dillaman@redhat.com>
Tue, 9 Mar 2021 21:50:10 +0000 (16:50 -0500)
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 <idryomov@gmail.com>
(cherry picked from commit b1bf3eaef200fb5d1aa847cad14936f2bbbf7b64)

src/librbd/image/PreRemoveRequest.cc

index 3ad92616af0005f3a05d0396818e500177ec1fd3..fa4141834b186c3b2a338363a638eef503abb3c7 100644 (file)
@@ -117,8 +117,9 @@ void PreRemoveRequest<I>::handle_exclusive_lock(int r) {
 
 template <typename I>
 void PreRemoveRequest<I>::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;
   }