]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: display sane hex value (0x0) for empty feature bit 52125/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:38:35 +0000 (10:08 +0530)
commit2410cbd0989129039a06c8c3615980f316d4102f
treea052af2020a8c2cd73bdff10406aabbe71c5a15a
parentbda07a66e1503394e0e172fa530e793f4be82cf3
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