From: Jeff Layton Date: Tue, 26 Jan 2021 16:49:54 +0000 (-0500) Subject: ceph: only check pool permissions for regular files X-Git-Tag: v5.13-rc1~30^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9b2250156c381b0973ea6ec3890fe8706426ecc;p=thirdparty%2Flinux.git 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 Signed-off-by: Jeff Layton Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index bc9864524fde0..aa612bc8a5597 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.