summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-04-22 12:41:49 -0700
committerSage Weil <sage@inktank.com>2013-04-22 12:41:49 -0700
commit5926ffa576e9477324ca00eaec731a224195e7db (patch)
treed1148d4c5776f8f64dd7cc5bb2ceb4b9ad4d9c08
parent5446218f7bda980dfcb73c853cb5af799bd14fdd (diff)
downloadceph-5926ffa576e9477324ca00eaec731a224195e7db.tar.gz
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 <sage@inktank.com>
-rw-r--r--src/rbd.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rbd.cc b/src/rbd.cc
index 84b5d191b0c..4cd59dd65f1 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);
}