From 2deb39cb5b98b0296b0309b05d19c2b7f8270db0 Mon Sep 17 00:00:00 2001 From: zhengyin Date: Mon, 21 Oct 2019 14:32:24 +0800 Subject: [PATCH] librbd: fix rbd_features_to_string output if features = 61, it will output ",deep-flattenexclusive-lockfast-difflayeringobject-map". I think "deep-flatten,exclusive-lock,fast-diff,layering,object-map" is suitable output. Signed-off-by: Zheng Yin --- src/librbd/Features.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librbd/Features.cc b/src/librbd/Features.cc index 8623adb4ee3..a2c25169c43 100644 --- a/src/librbd/Features.cc +++ b/src/librbd/Features.cc @@ -34,8 +34,8 @@ std::string rbd_features_to_string(uint64_t features, std::string r; for (auto& i : RBD_FEATURE_MAP) { if (features & i.second) { - if (r.empty()) { - r += ","; + if (!r.empty()) { + r += ","; } r += i.first; features &= ~i.second; -- 2.39.5