]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd: fix feature display for --info
authorSage Weil <sage@inktank.com>
Mon, 22 Apr 2013 19:38:11 +0000 (12:38 -0700)
committerSage Weil <sage@inktank.com>
Mon, 22 Apr 2013 19:38:11 +0000 (12:38 -0700)
Only include the feature if it is set!

Backport: bobtail
Signed-off-by: Sage Weil <sage@inktank.com>
src/rbd.cc

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