]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: only check pool permissions for regular files 40730/head
authorXiubo Li <xiubli@redhat.com>
Mon, 29 Mar 2021 04:02:09 +0000 (12:02 +0800)
committerRamana Raja <rraja@redhat.com>
Fri, 16 Apr 2021 21:54:41 +0000 (17:54 -0400)
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 22bd81dbb4cc170fb40c61c040e99e3fe8985db4..87de4cc7c6835ceec32fe69e45b60e588c16c5f4 100755 (executable)
@@ -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<int64_t, std::string> perm_key(pool_id, pool_ns);