[LU-16415] Lustre quota enforcement for root files in project quota Created: 20/Dec/22  Updated: 19/Apr/23  Resolved: 27/Jan/23

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.16.0

Type: Bug Priority: Minor
Reporter: Sergey Cheremencev Assignee: Sergey Cheremencev
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Related
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Quota project enforcement doesn't work for root.  

# mkdir /mnt/lustre/testdir
# chmod 777 /mnt/lustre/testdir# lfs project -p 10 -s /mnt/lustre/testdir
# lfs setquota -B 200M -p 10 /mnt/lustre/
# lfs quota -p 10 /mnt/lustre/
Disk quotas for prj 10 (pid 10):
     Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
    /mnt/lustre       4       0  204800       -       1       0       0       -
# id
uid=0(root) gid=0(root) groups=0(root)# dd if=/dev/zero of=/mnt/lustre/testdir/file bs=1M count=300
300+0 records in
300+0 records out
314572800 bytes (315 MB, 300 MiB) copied, 0.21125 s, 1.5 GB/s
# lfs quota -p 10 /mnt/lustre
Disk quotas for prj 10 (pid 10):
     Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
    /mnt/lustre  307112*      0  204800       -       2       0       0       -
pid 10 is using default file quota setting$ id
uid=8888(serega) gid=100(users) groups=100(users)
$ dd if=/dev/zero of=/mnt/lustretestdir/file bs=1M count=300
dd: error writing '/mnt/lustre/testdir/file': Disk quota exceeded
229+0 records in
228+0 records out
239075328 bytes (239 MB, 228 MiB) copied, 0.182616 s, 1.3 GB/s[root@ec01 ~]# lfs quota -p 10 /mnt/lustre
Disk quotas for prj 10 (pid 10):
     Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
    /mnt/lustre  233480*      0  204800       -       2       0       0       -
pid 10 is using default file quota setting
 


 Comments   
Comment by Gerrit Updater [ 20/Dec/22 ]

"Sergey Cheremencev <scherementsev@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/49460
Subject: LU-16415 quota: enforce project quota for root
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 61dfba34486686708404f5e9e4e45147b64a6497

Comment by Gerrit Updater [ 27/Jan/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/49460/
Subject: LU-16415 quota: enforce project quota for root
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: f147655c33ea61450105b602c82da900fd1417b5

Comment by Peter Jones [ 27/Jan/23 ]

Landed for 2.16

Generated at Sat Feb 10 03:26:49 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.