From: Mykola Golub Date: Mon, 23 May 2016 06:16:38 +0000 (+0300) Subject: librbd: clone: default to parent features X-Git-Tag: v11.0.0~423^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d305eaad8d57a6f64e6d80eebcd0839a65c9a668;p=ceph.git librbd: clone: default to parent features Fixes: http://tracker.ceph.com/issues/15982 Signed-off-by: Mykola Golub --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 47e0f701da02..cf3df39178ef 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -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);