Skip to content

Commit

Permalink
ceph: only check pool permissions for regular files
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jeff Layton <[email protected]>
Reviewed-by: Xiubo Li <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
  • Loading branch information
jtlayton authored and idryomov committed Apr 27, 2021
1 parent 3d8b698 commit e9b2250
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit e9b2250

Please sign in to comment.