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: v14.2.22~25^2~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2736063abd55be1801e15715dc779edaf3017389;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 22bd81dbb4cc..87de4cc7c683 100755 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -14262,6 +14262,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);