diff options
author | Josh Durgin <josh.durgin@inktank.com> | 2013-04-22 13:36:38 -0700 |
---|---|---|
committer | Josh Durgin <josh.durgin@inktank.com> | 2013-04-22 13:36:38 -0700 |
commit | cec5282b2a6e25401b728f8997a1ad435c540d46 (patch) | |
tree | 1dae6a89756bb9f5896b6594322316dd7c727ba8 | |
parent | 70e1e47da0970a4ad5cdd311aaaebf45361d5dff (diff) | |
parent | 5926ffa576e9477324ca00eaec731a224195e7db (diff) | |
download | ceph-cec5282b2a6e25401b728f8997a1ad435c540d46.tar.gz |
Merge pull request #232 from ceph/wip-4710
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r-- | src/rbd.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/rbd.cc b/src/rbd.cc index 39785225284..4cd59dd65f1 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -177,9 +177,11 @@ static string features_str(uint64_t features) for (uint64_t feature = 1; feature <= RBD_FEATURE_STRIPINGV2; feature <<= 1) { - if (s.size()) - s += ", "; - s += feature_str(feature); + if (feature & features) { + if (s.size()) + s += ", "; + s += feature_str(feature); + } } return s; } @@ -427,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); } |