ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ceph: only check pool permissions for regular files
@ 2021-03-25 16:56 Jeff Layton
  2021-03-26 15:10 ` Luis Henriques
  2021-03-29  3:59 ` Xiubo Li
  0 siblings, 2 replies; 3+ messages in thread
From: Jeff Layton @ 2021-03-25 16:56 UTC (permalink / raw)
  To: ceph-devel; +Cc: idryomov, Luis Henriques

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>
---
 fs/ceph/addr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index d26a88aca014..07cbf21099b8 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -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.
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ceph: only check pool permissions for regular files
  2021-03-25 16:56 [PATCH] ceph: only check pool permissions for regular files Jeff Layton
@ 2021-03-26 15:10 ` Luis Henriques
  2021-03-29  3:59 ` Xiubo Li
  1 sibling, 0 replies; 3+ messages in thread
From: Luis Henriques @ 2021-03-26 15:10 UTC (permalink / raw)
  To: Jeff Layton; +Cc: ceph-devel, idryomov

On Thu, Mar 25, 2021 at 12:56:06PM -0400, Jeff Layton wrote:
> 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>

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

> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/ceph/addr.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index d26a88aca014..07cbf21099b8 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -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.
> -- 
> 2.30.2
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ceph: only check pool permissions for regular files
  2021-03-25 16:56 [PATCH] ceph: only check pool permissions for regular files Jeff Layton
  2021-03-26 15:10 ` Luis Henriques
@ 2021-03-29  3:59 ` Xiubo Li
  1 sibling, 0 replies; 3+ messages in thread
From: Xiubo Li @ 2021-03-29  3:59 UTC (permalink / raw)
  To: Jeff Layton, ceph-devel; +Cc: idryomov, Luis Henriques

On 2021/3/26 0:56, Jeff Layton wrote:
> 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>
> ---
>   fs/ceph/addr.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index d26a88aca014..07cbf21099b8 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -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.

Reviewed-by: Xiubo Li <xiubli@redhat.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-29  4:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25 16:56 [PATCH] ceph: only check pool permissions for regular files Jeff Layton
2021-03-26 15:10 ` Luis Henriques
2021-03-29  3:59 ` Xiubo Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).