]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: only set STRIPINGV2 feature when needed 232/head
authorSage Weil <sage@inktank.com>
Mon, 22 Apr 2013 19:41:49 +0000 (12:41 -0700)
committerSage Weil <sage@inktank.com>
Mon, 22 Apr 2013 19:41:49 +0000 (12:41 -0700)
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>
src/rbd.cc

index 84b5d191b0cc96e4f3db2a6264e3357cc0cd642b..4cd59dd65f19e6618e4d3b43e582c822bfc0f73b 100644 (file)
@@ -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);
   }