]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: skip uneccessary caller gid list check
authorXiubo Li <xiubli@redhat.com>
Tue, 7 Nov 2023 05:17:12 +0000 (13:17 +0800)
committerKotresh HR <khiremat@redhat.com>
Wed, 9 Oct 2024 08:01:40 +0000 (13:31 +0530)
Once the caller_gid is matched it will make no sense to do the
following caller gid list check.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit bd3e01926fc472cfddb0b6bb79b822595632b378)

src/mds/MDSAuthCaps.cc

index 22383445e67a4a77eda9181d1a55f68629ae5955..23374c4039fad69f13922f7f02c62fc316af066c 100644 (file)
@@ -145,7 +145,7 @@ bool MDSCapMatch::match(string_view target_path,
       bool gid_matched = false;
       if (std::find(gids.begin(), gids.end(), caller_gid) != gids.end())
        gid_matched = true;
-      if (caller_gid_list) {
+      else if (caller_gid_list) {
        for (auto i = caller_gid_list->begin(); i != caller_gid_list->end(); ++i) {
          if (std::find(gids.begin(), gids.end(), *i) != gids.end()) {
            gid_matched = true;