From df81ba1c7f11e7b2bca5911d46ea7dec284652cd Mon Sep 17 00:00:00 2001 From: Dongsheng Yang Date: Tue, 21 Jun 2016 05:13:21 -0400 Subject: [PATCH] librbd: set RBD_FEATURE_STRIPINGV2 in create if needed. Signed-off-by: Dongsheng Yang --- src/librbd/internal.cc | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 28705f703aef..4702e8df4c2c 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -1325,8 +1325,7 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force, if ((features & RBD_FEATURE_STRIPINGV2) == 0 && ((stripe_unit && stripe_unit != (1ull << order)) || (stripe_count && stripe_count != 1))) { - lderr(cct) << "STRIPINGV2 and format 2 or later required for non-default striping" << dendl; - return -EINVAL; + features |= RBD_FEATURE_STRIPINGV2; } if ((stripe_unit && !stripe_count) || @@ -1514,11 +1513,6 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force, c_opts.set(RBD_IMAGE_OPTION_ORDER, order); } - if (c_opts.get(RBD_IMAGE_OPTION_STRIPE_UNIT, &stripe_unit) == 0 || - c_opts.get(RBD_IMAGE_OPTION_STRIPE_COUNT, &stripe_count) == 0) { - features |= RBD_FEATURE_STRIPINGV2; - } - c_opts.set(RBD_IMAGE_OPTION_FEATURES, features); r = create(c_ioctx, c_name, size, c_opts, non_primary_global_image_id, primary_mirror_uuid); @@ -2284,14 +2278,10 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force, uint64_t stripe_unit = src->stripe_unit; if (opts.get(RBD_IMAGE_OPTION_STRIPE_UNIT, &stripe_unit) != 0) { opts.set(RBD_IMAGE_OPTION_STRIPE_UNIT, stripe_unit); - } else { - features |= RBD_FEATURE_STRIPINGV2; } uint64_t stripe_count = src->stripe_count; if (opts.get(RBD_IMAGE_OPTION_STRIPE_COUNT, &stripe_count) != 0) { opts.set(RBD_IMAGE_OPTION_STRIPE_COUNT, stripe_count); - } else { - features |= RBD_FEATURE_STRIPINGV2; } uint64_t order = src->order; if (opts.get(RBD_IMAGE_OPTION_ORDER, &order) != 0) { -- 2.47.3