]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: clone: default to parent features
authorMykola Golub <mgolub@mirantis.com>
Mon, 23 May 2016 06:16:38 +0000 (09:16 +0300)
committerMykola Golub <mgolub@mirantis.com>
Mon, 23 May 2016 06:23:11 +0000 (09:23 +0300)
Fixes: http://tracker.ceph.com/issues/15982
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/librbd/internal.cc

index 47e0f701da02f4a27155ece1c4751bdfeef644e6..cf3df39178efdd0760334e818aea75e6b5bdacd4 100644 (file)
@@ -1389,12 +1389,14 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force,
       return -EINVAL;
     }
 
+    bool use_p_features = true;
     uint64_t features;
-    if (c_opts.get(RBD_IMAGE_OPTION_FEATURES, &features) != 0) {
+    if (c_opts.get(RBD_IMAGE_OPTION_FEATURES, &features) == 0) {
       if (features & ~RBD_FEATURES_ALL) {
        lderr(cct) << "librbd does not support requested features" << dendl;
        return -ENOSYS;
       }
+      use_p_features = false;
     }
 
     // make sure child doesn't already exist, in either format
@@ -1447,7 +1449,7 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force,
       r = -ENOSYS;
       goto err_close_parent;
     }
-    
+
     if (r < 0) {
       // we lost the race with snap removal?
       lderr(cct) << "unable to locate parent's snapshot" << dendl;
@@ -1460,6 +1462,10 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force,
       goto err_close_parent;
     }
 
+    if (use_p_features) {
+      c_opts.set(RBD_IMAGE_OPTION_FEATURES, p_features);
+    }
+
     order = p_imctx->order;
     if (c_opts.get(RBD_IMAGE_OPTION_ORDER, &order) != 0) {
       c_opts.set(RBD_IMAGE_OPTION_ORDER, order);