[LU-15519] fallocate does not increase projid quota usage Created: 03/Feb/22  Updated: 19/Oct/23  Resolved: 30/May/22

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

Type: Bug Priority: Major
Reporter: Andreas Dilger Assignee: Arshad Hussain
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Cloners
Clones LU-15167 fallocate does not increase quota usage Resolved
Related
is related to LU-14157 Implement fallocate() support for zfs... Open
is related to LU-3606 Implement fallocate() support for ldi... Resolved
is related to LU-12480 add STATX_PROJID to upstream kernel Open
is related to LU-15683 sanity-flr.sh test_50c: proper initia... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Using "fallocate -l <size> <file>" to allocate space to <file> does not increase the quota usage for the affected project:

# lfs quota -p 1000 /mnt/testfs
Disk quotas for prj 1000 (pid 1000):
     Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
    /mnt/testfs  102408       0  204800       -       3       0   10000       -
# mkdir /mnt/testfs/projdir
# lfs project -p 1000 /mnt/testfs/projdir
# fallocate -l 50M /mnt/testfs/projdir/50M
# lfs quota -p 1000 /mnt/testfs
Disk quotas for prj 1000 (pid 1000):
     Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
    /mnt/testfs  102408       0  204800       -       4       0   10000       -


 Comments   
Comment by Andreas Dilger [ 03/Feb/22 ]

Not sure if there is still time to fix this in 2.15.0, but if the patch misses the cutoff there is always 2.15.1.

Comment by Andreas Dilger [ 03/Feb/22 ]

Just taking a quick look into the code where OBD_MD_FLUID is used, this may need changes on the client in obdo_from_inode(), vvp_req_attr_set(), osc_io_setattr_start(), struct cl_setattr_io sa_falloc_prjid, osc_brw_prep_request(), lustre_set_wire_obdo().

On the server, it also looks like mdt_obd_commitrw() and dump_obdo() are missing to sete OBD_MD_FLPROJID even though o_projid is set.

It also wouldn't hurt to copy o_projid in obdo_cpy_md(), which is only used in echo.c, even though I don't think it affects normal operation.

Comment by Arshad Hussain [ 04/Feb/22 ]

Hi Andreas, Thanks for putting in the details. I am looking into this. Targeting 2.15.1

Thanks!

Comment by Gerrit Updater [ 02/Mar/22 ]

"Arshad Hussain <arshad.hussain@aeoncomputing.com>" uploaded a new patch: https://review.whamcloud.com/46676
Subject: LU-15519 quota: fallocate does not increase projectid usage
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 19337471bf2786792311796a68c50db7d3781578

Comment by Gerrit Updater [ 30/May/22 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/46676/
Subject: LU-15519 quota: fallocate does not increase projectid usage
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 5fc934ebbbe665f24e2f11fe224065dd8e9a08ba

Comment by Peter Jones [ 30/May/22 ]

Landed for 2.16

Comment by Gerrit Updater [ 03/Jul/23 ]

"Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51535
Subject: LU-15519 quota: fallocate does not increase projectid usage
Project: fs/lustre-release
Branch: b2_15
Current Patch Set: 1
Commit: 3908b15e915c985ec8bae2d6d5940446d38f1c49

Comment by Gerrit Updater [ 19/Oct/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/51535/
Subject: LU-15519 quota: fallocate does not increase projectid usage
Project: fs/lustre-release
Branch: b2_15
Current Patch Set:
Commit: 691387d77bfe9260b65669978fb3f988055fc1e0

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