]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: display sane hex value (0x0) for empty feature bit 52127/head
authorJos Collin <jcollin@redhat.com>
Mon, 22 May 2023 04:31:39 +0000 (10:01 +0530)
committerJos Collin <jcollin@redhat.com>
Tue, 20 Jun 2023 04:43:44 +0000 (10:13 +0530)
commit545b0449fadc672f227f0391d8222b18dbfa9792
tree2d7760f1f401a9d394faa7e786c062029a14ae77
parent6c734507057d3714b7124a35469cdd81975d76f6
mds: display sane hex value (0x0) for empty feature bit

Print a valid hex (0x0) during empty feature bit, so that the clients could recognize it.
When the _vec size becomes 0, print() function creates an invalid hex (0x) and 'perf stats'
crashes with the below error:
"
File "/opt/ceph/src/pybind/mgr/stats/fs/perf_stats.py", line 177, in notify_cmd
metric_features = int(metadata[CLIENT_METADATA_KEY]["metric_spec"]["metric_flags"]["feature_bits"], 16)
ValueError: invalid literal for int() with base 16: '0x'
"
This patch creates  a valid hex (0x0), when _vec size is 0.

Fixes: https://tracker.ceph.com/issues/59551
Signed-off-by: Jos Collin <jcollin@redhat.com>
(cherry picked from commit 2ee9b3af82c788ecd68d09d5bd97d80f07dae0ca)
src/mds/mdstypes.cc