Only set the STRIPINGV2 feature if the striping parameters are non-default.
Specifically, fix the case where the passed-in size and count are == 0.
Fixes: #4710
Signed-off-by: Sage Weil <sage@inktank.com>
if (features == 0) {
features = RBD_FEATURE_LAYERING;
}
- if (stripe_unit != (1ull << *order) && stripe_count != 1)
+ if ((stripe_unit || stripe_count) &&
+ (stripe_unit != (1ull << *order) && stripe_count != 1)) {
features |= RBD_FEATURE_STRIPINGV2;
+ }
r = rbd.create3(io_ctx, imgname, size, features, order,
stripe_unit, stripe_count);
}