]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: only set STRIPINGV2 feature when needed 238/head
authorJosh Durgin <josh.durgin@inktank.com>
Tue, 23 Apr 2013 16:18:30 +0000 (09:18 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Tue, 23 Apr 2013 18:33:18 +0000 (11:33 -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>
(cherry picked from commit 5926ffa576e9477324ca00eaec731a224195e7db)

Conflicts:

src/rbd.cc

src/rbd.cc

index 42973d1286b7b3c81a93586aad7f0885a59945c4..30686b4144fcac6509c28a58ff8c5433ff4d589e 100644 (file)
@@ -293,9 +293,12 @@ 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);
+    }
+    r = rbd.create3(io_ctx, imgname, size, features, order,
+                   stripe_unit, stripe_count);
   }
   if (r < 0)
     return r;