]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: added missing locks for snap rollback and rename 19123/head
authorJason Dillaman <dillaman@redhat.com>
Tue, 14 Nov 2017 17:07:36 +0000 (12:07 -0500)
committerPrashant D <pdhange@redhat.com>
Tue, 30 Jan 2018 01:59:45 +0000 (20:59 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 0ccd26f9989b892be2ab620bcf7f4fbf14980e8e)

src/librbd/Operations.cc
src/librbd/operation/SnapshotRollbackRequest.cc

index 3a9d1dacb8f5ade30a5cbfee3c57f7b5861a14b5..5a6303670e74b3f49448067001a49fbb0a512c41 100644 (file)
@@ -585,6 +585,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);