]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: do not infinitely recursively print a metric 41596/head
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 2 Jun 2021 14:28:49 +0000 (07:28 -0700)
committerXiubo Li <xiubli@redhat.com>
Fri, 4 Jun 2021 04:42:45 +0000 (12:42 +0800)
Fixes: b1b44d775df3160d937c068d5e1079e24199ed6b
Fixes: https://tracker.ceph.com/issues/51067
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 20a622a87ea4cd9671d975d09d33363726f4fc69)

src/include/cephfs/metrics/Types.h

index c89441695c820eca15e8eac3328e2e1169dc30fc..0c12de7c3b199747f14d4b46719e763fcf33fab9 100644 (file)
@@ -53,7 +53,8 @@ inline std::ostream &operator<<(std::ostream &os, const ClientMetricType &type)
     os << "OPENED_INODES";
     break;
   default:
-    os << "Unknown metric type: " << type;
+    os << "(UNKNOWN:" << static_cast<std::underlying_type<ClientMetricType>::type>(type) << ")";
+    break;
   }
 
   return os;