From b7e15965e77fc2fbb1827ef4401372c13eacba74 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Mon, 29 Mar 2021 12:02:09 +0800 Subject: [PATCH] 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) --- src/client/Client.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/Client.cc b/src/client/Client.cc index 9e1403cd7f2b9..a94876881abda 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -14928,6 +14928,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); -- 2.39.5