]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mds: display sane hex value (0x0) for empty feature bit 51655/head
authorJos Collin <jcollin@redhat.com>
Mon, 22 May 2023 04:31:39 +0000 (10:01 +0530)
committerJos Collin <jcollin@redhat.com>
Mon, 19 Jun 2023 07:54:19 +0000 (13:24 +0530)
commit2ee9b3af82c788ecd68d09d5bd97d80f07dae0ca
treee32d149905ca2615a1d7b641583e786bb5893889
parent1ee89e3fe3064cd33672c010f1b381770f3b9646
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>
src/mds/mdstypes.cc