]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/volumes: Keep mon caps if auth key has remaining mds/osd caps
authorEnrico Bocchi <enrico.bocchi@cern.ch>
Mon, 26 Aug 2024 11:30:02 +0000 (13:30 +0200)
committerVenky Shankar <vshankar@redhat.com>
Mon, 23 Jun 2025 07:22:15 +0000 (12:52 +0530)
Signed-off-by: Enrico Bocchi <enrico.bocchi@cern.ch>
src/pybind/mgr/volumes/fs/operations/access.py

index 7e916e95539e7de8a49d6d958a906426c125e2ce..1fa247fd5147b167da26da8d392d5eb9d3e658d9 100644 (file)
@@ -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(
             {