diff options
author | Jeff Layton <jlayton@kernel.org> | 2021-01-26 19:49:54 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2021-04-28 00:52:23 +0300 |
commit | e9b2250156c381b0973ea6ec3890fe8706426ecc (patch) | |
tree | 56bf404e8d2b95ee2a6b59638ffb26fb1c615c72 | |
parent | 3d8b6987a276f4292b5b71f4df8fe34129ab9e5d (diff) | |
download | linux-e9b2250156c381b0973ea6ec3890fe8706426ecc.tar.xz |
ceph: only check pool permissions for regular files
There is no need to do a ceph_pool_perm_check() 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.
Reported-by: Luis Henriques <lhenriques@suse.de>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r-- | fs/ceph/addr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index bc9864524fde..aa612bc8a559 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1941,6 +1941,10 @@ int ceph_pool_perm_check(struct inode *inode, int need) s64 pool; int ret, flags; + /* Only need to do this for regular files */ + if (!S_ISREG(inode->i_mode)) + return 0; + if (ci->i_vino.snap != CEPH_NOSNAP) { /* * Pool permission check needs to write to the first object. |