From 5446218f7bda980dfcb73c853cb5af799bd14fdd Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 22 Apr 2013 12:38:11 -0700 Subject: [PATCH] rbd: fix feature display for --info Only include the feature if it is set! Backport: bobtail Signed-off-by: Sage Weil --- src/rbd.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rbd.cc b/src/rbd.cc index 39785225284..84b5d191b0c 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; } -- 2.47.3