From: Sage Weil Date: Mon, 22 Apr 2013 19:41:49 +0000 (-0700) Subject: rbd: only set STRIPINGV2 feature when needed X-Git-Tag: v0.61~126^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5926ffa576e9477324ca00eaec731a224195e7db;p=ceph.git 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 --- 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); }