From: Xiubo Li Date: Tue, 7 Nov 2023 05:17:12 +0000 (+0800) Subject: mds: skip uneccessary caller gid list check X-Git-Tag: v18.2.5~118^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=395dde2c355e480278f620273f6e7de40dc1d9e6;p=ceph.git mds: skip uneccessary caller gid list check Once the caller_gid is matched it will make no sense to do the following caller gid list check. Signed-off-by: Xiubo Li (cherry picked from commit bd3e01926fc472cfddb0b6bb79b822595632b378) --- diff --git a/src/mds/MDSAuthCaps.cc b/src/mds/MDSAuthCaps.cc index 22383445e67a..23374c4039fa 100644 --- a/src/mds/MDSAuthCaps.cc +++ b/src/mds/MDSAuthCaps.cc @@ -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;