]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: only check pool permissions for regular files 40686/head
authorXiubo Li <xiubli@redhat.com>
Mon, 29 Mar 2021 04:02:09 +0000 (12:02 +0800)
committersinguliere <singuliere@autistici.org>
Fri, 9 Apr 2021 05:31:57 +0000 (07:31 +0200)
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 <xiubli@redhat.com>
(cherry picked from commit 59a3006b88f479cb5333e16fe30201ea14ab1717)

src/client/Client.cc

index 9e1403cd7f2b9b5929feb6501c0b80eb7aca71ba..a94876881abda1f2aa04e1f55328f0c39d471066 100644 (file)
@@ -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<int64_t, std::string> perm_key(pool_id, pool_ns);