From 0882bbe8a4470f82993d87b7c02b19aa7fe7fbcc Mon Sep 17 00:00:00 2001 From: Enrico Bocchi Date: Mon, 26 Aug 2024 13:30:02 +0200 Subject: [PATCH] mgr/volumes: Keep mon caps if auth key has remaining mds/osd caps Signed-off-by: Enrico Bocchi --- src/pybind/mgr/volumes/fs/operations/access.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/volumes/fs/operations/access.py b/src/pybind/mgr/volumes/fs/operations/access.py index 7e916e95539e7..1fa247fd5147b 100644 --- a/src/pybind/mgr/volumes/fs/operations/access.py +++ b/src/pybind/mgr/volumes/fs/operations/access.py @@ -125,7 +125,12 @@ def deny_access(mgr, client_entity, want_mds_caps, want_osd_caps): mds_cap_str, osd_cap_str = cap_remove(orig_mds_caps, orig_osd_caps, want_mds_caps, want_osd_caps) - caps_list = prepare_updated_caps_list(cap, mds_cap_str, osd_cap_str, authorize=False) + # The same auth key may be used for multiple subvolumes + # If upon cap_remove the key still has mds or osd caps, it must also keep + # mon caps so that the client is allowed to check in with the mons. + auth = True if mds_cap_str or osd_cap_str else False + + caps_list = prepare_updated_caps_list(cap, mds_cap_str, osd_cap_str, authorize=auth) if not caps_list: mgr.mon_command( { -- 2.39.5