]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
mds: display sane hex value (0x0) for empty feature bit
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:41:52 +0000 (10:11 +0530)
commit8dc6a8ed6a498fda249ca93ccad1b0ce2f5563df
treefcc5ad5d532851b2c629ec079c97fa0e3f892afc
parentce7f1a316ccd864c16e87da5e6471578801f9b48
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