From: Xiubo Li Date: Mon, 29 Mar 2021 04:02:09 +0000 (+0800) Subject: client: only check pool permissions for regular files X-Git-Tag: v15.2.13~8^2~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e3cea5f764c13bea731c9c7ae0d67f5d57306345;p=ceph.git client: only check pool permissions for regular files There is no need to do a check_pool_perm() on anything that isn't a regular file, as the MDS is what handles talking to the OSD in those cases. Just return 0 if it's not a regular file. Signed-off-by: Xiubo Li (cherry picked from commit 59a3006b88f479cb5333e16fe30201ea14ab1717) --- diff --git a/src/client/Client.cc b/src/client/Client.cc index 06254493ea5..25c9a046703 100755 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -14370,6 +14370,10 @@ int Client::check_pool_perm(Inode *in, int need) if (!cct->_conf->client_check_pool_perm) return 0; + /* Only need to do this for regular files */ + if (!in->is_file()) + return 0; + int64_t pool_id = in->layout.pool_id; std::string pool_ns = in->layout.pool_ns; std::pair perm_key(pool_id, pool_ns);