]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: ensure exclusive lock acquired when removing sync point snapshots 24123/head
authorMykola Golub <mgolub@suse.com>
Tue, 17 Jul 2018 19:45:18 +0000 (22:45 +0300)
committerJason Dillaman <dillaman@redhat.com>
Mon, 1 Oct 2018 18:52:20 +0000 (14:52 -0400)
Fixes: http://tracker.ceph.com/issues/24898
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit 5bb823098ed0728cf9b88c654ba4528f3e42d695)

src/librbd/mirror/DisableRequest.cc
src/test/librbd/mirror/test_mock_DisableRequest.cc

index bcbff06a452f23c0b63bf8347aa5d83769ec8c54..3cfe73a2592768a95c6889faaf19a52c1aac59b0 100644 (file)
@@ -313,10 +313,9 @@ void DisableRequest<I>::send_remove_snap(const std::string &client_id,
     &DisableRequest<I>::handle_remove_snap, client_id);
 
   ctx = new FunctionContext([this, snap_namespace, snap_name, ctx](int r) {
-      RWLock::WLocker owner_locker(m_image_ctx->owner_lock);
-      m_image_ctx->operations->execute_snap_remove(snap_namespace,
-                                                  snap_name.c_str(),
-                                                  ctx);
+      m_image_ctx->operations->snap_remove(snap_namespace,
+                                           snap_name.c_str(),
+                                           ctx);
     });
 
   m_image_ctx->op_work_queue->queue(ctx, 0);
index 6334e9b4f13354659727ca52bc31aa9698fd494c..c0b4fe291af24a4c47675f9b0f5937a9cf85e977 100644 (file)
@@ -192,7 +192,7 @@ public:
 
   void expect_snap_remove(MockTestImageCtx &mock_image_ctx,
                           const std::string &snap_name, int r) {
-    EXPECT_CALL(*mock_image_ctx.operations, execute_snap_remove(_, StrEq(snap_name), _))
+    EXPECT_CALL(*mock_image_ctx.operations, snap_remove(_, StrEq(snap_name), _))
       .WillOnce(WithArg<2>(CompleteContext(r, mock_image_ctx.image_ctx->op_work_queue)));
   }