]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
librbd: adjust the logic of validate_striping
authormxdInspur <muxiangdong@inspur.com>
Sat, 31 Aug 2019 07:33:38 +0000 (15:33 +0800)
committermxdInspur <muxiangdong@inspur.com>
Tue, 10 Sep 2019 01:42:08 +0000 (09:42 +0800)
Signed-off-by: mxdInspur <muxiangdong@inspur.com>
src/librbd/image/CreateRequest.cc

index 686e7639474961585f03a27f09b64936b940cdd9..44428868ad5d1aa1d4a6f02d0b02705e3be20b1c 100644 (file)
@@ -71,11 +71,9 @@ int validate_striping(CephContext *cct, uint8_t order, uint64_t stripe_unit,
     lderr(cct) << "must specify both (or neither) of stripe-unit and "
                << "stripe-count" << dendl;
     return -EINVAL;
-  } else if (stripe_unit || stripe_count) {
-    if ((1ull << order) % stripe_unit || stripe_unit > (1ull << order)) {
-      lderr(cct) << "stripe unit is not a factor of the object size" << dendl;
-      return -EINVAL;
-    }
+  } else if (stripe_unit && ((1ull << order) % stripe_unit || stripe_unit > (1ull << order))) {
+    lderr(cct) << "stripe unit is not a factor of the object size" << dendl;
+    return -EINVAL;
   }
   return 0;
 }