ceph: only check pool permissions for regular files
PATCH 1/1 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.
--- fs/ceph/addr.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/ceph/addr.c +4 -0
@@ -1940,6 +1940,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.
Signature · 1 line
2.30.2
Quoted 5 lines · Jeff Layton
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]>
Looks good to me, thanks!
[ Took me a while to find when/where I reported that -- it was completely
swapped out from my memory! But I finally found it on my IRC logs. ]
Cheers,
--
Luís
Quoted 23 lines
Signed-off-by Jeff Layton <[email protected]>--- fs/ceph/addr.c | 4 ++++ 1 file changed, 4 insertions(+)fs/ceph/addr.c +4
-0@@ -1940,6 +1940,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. Signature · 1 line
2.30.2
Quoted 15 lines · Jeff Layton
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]>--- fs/ceph/addr.c | 4 ++++ 1 file changed, 4 insertions(+)fs/ceph/addr.c +0
-0
fs/ceph/addr.c int ceph_pool_perm_check(struct inode *inode, int need) · line 1949
Quoted 10 lines
fs/ceph/addr.c +4
-0@@ -1940,6 +1940,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.