]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: set RBD_FEATURE_STRIPINGV2 in create if needed.
authorDongsheng Yang <dongsheng.yang@easystack.cn>
Tue, 21 Jun 2016 09:13:21 +0000 (05:13 -0400)
committerDongsheng Yang <dongsheng.yang@easystack.cn>
Fri, 22 Jul 2016 11:04:09 +0000 (07:04 -0400)
Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
src/librbd/internal.cc

index 28705f703aefa795d697f8f096422347ffa53e41..4702e8df4c2c6343576acf3e32767bb03a89aebc 100644 (file)
@@ -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) {