]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: ensure exclusive lock acquired when removing sync point snapshots 24137/head
authorMykola Golub <mgolub@suse.com>
Tue, 17 Jul 2018 19:45:18 +0000 (22:45 +0300)
committerPrashant D <pdhange@redhat.com>
Tue, 18 Sep 2018 00:37:17 +0000 (20:37 -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 7968284792a6b530f75270c8370ff26db6cf9d73..41c7e9e01b6e70135b84a0a63b31ddf67ffda5e8 100644 (file)
@@ -314,10 +314,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 df5a9c3e76c6fbe2be973d821c2fb5af0afddf0a..a15bc0777d798ad7559956d9579d0220c7a312d6 100644 (file)
@@ -195,7 +195,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)));
   }