]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: do not allow to deep copy migrating image 27882/head
authorMykola Golub <mgolub@suse.com>
Tue, 26 Mar 2019 15:09:58 +0000 (15:09 +0000)
committerPrashant D <pdhange@redhat.com>
Tue, 30 Apr 2019 04:13:48 +0000 (00:13 -0400)
Fixes: https://tracker.ceph.com/issues/38661
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit aeb9192011000bbecc7afa64fb6b7b4e58b5c448)

src/librbd/api/Image.cc

index 48bec35da0c21558024ff567ead1f78722bc5b00..13c5a90d8c547421945af4d0a7bd0484e646abad 100644 (file)
@@ -520,6 +520,12 @@ int Image<I>::deep_copy(I *src, librados::IoCtx& dest_md_ctx,
   uint64_t src_size;
   {
     RWLock::RLocker snap_locker(src->snap_lock);
+
+    if (!src->migration_info.empty()) {
+      lderr(cct) << "cannot deep copy migrating image" << dendl;
+      return -EBUSY;
+    }
+
     features = (src->features & ~RBD_FEATURES_IMPLICIT_ENABLE);
     src_size = src->get_image_size(src->snap_id);
   }