]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - fs/ceph/mds_client.c
ceph: quota: fix quota subdir mounts
authorLuis Henriques <lhenriques@suse.com>
Thu, 21 Mar 2019 10:20:10 +0000 (10:20 +0000)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 7 May 2019 17:22:36 +0000 (19:22 +0200)
commit0c44a8e0fc55f56a70f72e67d7cc5b9341dae7d1
tree22ff1d529ddff80eb05f19809f37ceda342b900c
parent3886274adf34a4e38417772e3d1c0b213380004e
ceph: quota: fix quota subdir mounts

The CephFS kernel client does not enforce quotas set in a directory that
isn't visible from the mount point.  For example, given the path
'/dir1/dir2', if quotas are set in 'dir1' and the filesystem is mounted with

  mount -t ceph <server>:<port>:/dir1/ /mnt

then the client won't be able to access 'dir1' inode, even if 'dir2' belongs
to a quota realm that points to it.

This patch fixes this issue by simply doing an MDS LOOKUPINO operation for
unknown inodes.  Any inode reference obtained this way will be added to a
list in ceph_mds_client, and will only be released when the filesystem is
umounted.

Link: https://tracker.ceph.com/issues/38482
Reported-by: Hendrik Peyerl <hpeyerl@plusline.net>
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/mds_client.c
fs/ceph/mds_client.h
fs/ceph/quota.c
fs/ceph/super.h