From: Mykola Golub Date: Tue, 17 Jul 2018 19:45:18 +0000 (+0300) Subject: librbd: ensure exclusive lock acquired when removing sync point snapshots X-Git-Tag: v12.2.9~31^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=05070d672ad93d3d42e81b532a90274cf1b07cb6;p=ceph.git librbd: ensure exclusive lock acquired when removing sync point snapshots Fixes: http://tracker.ceph.com/issues/24898 Signed-off-by: Mykola Golub (cherry picked from commit 5bb823098ed0728cf9b88c654ba4528f3e42d695) --- diff --git a/src/librbd/mirror/DisableRequest.cc b/src/librbd/mirror/DisableRequest.cc index bcbff06a452f..3cfe73a25927 100644 --- a/src/librbd/mirror/DisableRequest.cc +++ b/src/librbd/mirror/DisableRequest.cc @@ -313,10 +313,9 @@ void DisableRequest::send_remove_snap(const std::string &client_id, &DisableRequest::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); diff --git a/src/test/librbd/mirror/test_mock_DisableRequest.cc b/src/test/librbd/mirror/test_mock_DisableRequest.cc index 6334e9b4f133..c0b4fe291af2 100644 --- a/src/test/librbd/mirror/test_mock_DisableRequest.cc +++ b/src/test/librbd/mirror/test_mock_DisableRequest.cc @@ -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))); }