]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerXiubo Li <xiubli@redhat.com>
Wed, 8 Nov 2023 01:33:14 +0000 (09:33 +0800)
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>
src/mds/MDSAuthCaps.cc

index 7ddad41a08fa217447fc4fe13da1b7c7948648b4..ca4add2f323b4cb9be3318b9bc8011ffce4ad5d8 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;