From 5926ffa576e9477324ca00eaec731a224195e7db Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 22 Apr 2013 12:41:49 -0700 Subject: [PATCH] rbd: only set STRIPINGV2 feature when needed 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 --- src/rbd.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rbd.cc b/src/rbd.cc index 84b5d191b0cc..4cd59dd65f19 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -429,8 +429,10 @@ static int do_create(librbd::RBD &rbd, librados::IoCtx& io_ctx, 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); } -- 2.47.3