]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: added missing locks for snap rollback and rename 18909/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 14 Nov 2017 17:07:36 +0000 (12:07 -0500)
committerJason Dillaman <dillaman@redhat.com>
Wed, 15 Nov 2017 18:25:36 +0000 (13:25 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/Operations.cc
src/librbd/operation/SnapshotRollbackRequest.cc

index d64434df5776fb7821bef0d34865aedcfb1bf042..393a8b2d7c80a212ea570ddd34b41cb5293aee99 100644 (file)
@@ -586,6 +586,7 @@ void Operations<I>::execute_rename(const std::string &dest_name,
        m_image_ctx.image_watcher->register_watch(on_finish);
       });
     on_finish = new FunctionContext([this, dest_name, on_finish](int r) {
+        RWLock::RLocker owner_locker(m_image_ctx.owner_lock);
        operation::RenameRequest<I> *req = new operation::RenameRequest<I>(
          m_image_ctx, on_finish, dest_name);
        req->send();
index 2dcffbc0189117b8f608fd7e367b43637796196b..f224b68fcc4f97e02e0433a0a4eb395ca585ef6a 100644 (file)
@@ -134,6 +134,7 @@ void SnapshotRollbackRequest<I>::send_resize_image() {
   CephContext *cct = image_ctx.cct;
   ldout(cct, 5) << this << " " << __func__ << dendl;
 
+  RWLock::RLocker owner_locker(image_ctx.owner_lock);
   Context *ctx = create_context_callback<
     SnapshotRollbackRequest<I>,
     &SnapshotRollbackRequest<I>::handle_resize_image>(this);