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: v13.2.3~162^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F24137%2Fhead;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 7968284792a6b..41c7e9e01b6e7 100644 --- a/src/librbd/mirror/DisableRequest.cc +++ b/src/librbd/mirror/DisableRequest.cc @@ -314,10 +314,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 df5a9c3e76c6f..a15bc0777d798 100644 --- a/src/test/librbd/mirror/test_mock_DisableRequest.cc +++ b/src/test/librbd/mirror/test_mock_DisableRequest.cc @@ -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))); }