Bug #24133
closedmds: broadcast quota to relevant clients when quota is explicitly set
0%
Description
We found client won't get quota updated for a long time under following case. We found this issue on Luminous, but it might be also existed on previous versions.
Steps to reproduce:
1. mount a ceph-fuse client-1 (for admin) on host-1 and set quota as follows.
[ceph@x1 ~]$ sudo setfattr -n ceph.quota.max_bytes -v 100000 /mnt/cephfs/test10/ [ceph@x1 ~]$ sudo setfattr -n ceph.quota.max_bytes -v 200000 /mnt/cephfs/test10/test11/
2. unmount above ceph-fuse client-1
3. mount another ceph-fuse client-2 (for user) on host-2 and copy some files into sub-directory test11. Since test10's quota is less than test11's, quota will be exceeded first on test10.
[ceph@x2 ~]$ sudo cp config /mnt/cephfs/test10/test11/2 cp: error writing '/mnt/cephfs/test10/test11/2': Disk quota exceeded cp: failed to extend '/mnt/cephfs/test10/test11/2': Disk quota exceeded
4. mount a ceph-fuse client-1 (for admin) on host-1 again and change test10's quota.
[ceph@x1 ~]$ sudo setfattr -n ceph.quota.max_bytes -v 200000 /mnt/cephfs/test10/
5. unmount above ceph-fuse client-1
6. continue copying files into sub-directory test11 on host-2. It will still return quota exceeded for a long time, or until explicitly call getfattr to get quota back.
[ceph@x2 ~]$ sudo cp config /mnt/cephfs/test10/test11/3 cp: error writing '/mnt/cephfs/test10/test11/3': Disk quota exceeded cp: failed to extend '/mnt/cephfs/test10/test11/3': Disk quota exceeded
The reason is that MDS only broadcasts quota under two cases, but above case is not one of them. So I think we could broadcast quota to relevant clients proactively if quota is explicitly set by someone.