Re: [PATCH] ceph: only check pool permissions for regular files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
  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@xxxxxxxxxx>




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux