[LU-15167] fallocate does not increase quota usage Created: 27/Oct/21  Updated: 24/Jun/22  Resolved: 13/Dec/21

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

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

Issue Links:
Cloners
is cloned by LU-15519 fallocate does not increase projid qu... Resolved
Related
is related to LU-15748 interop: sanity test_150b: fallocate ... Resolved
is related to LU-14157 Implement fallocate() support for zfs... Open
is related to LU-3606 Implement fallocate() support for ldi... 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 user/group/project:

# lfs quota -u 1000 /mnt/testfs
Disk quotas for usr 1000 (uid 1000):
     Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
    /mnt/testfs  102408       0       0       -       3       0       0       -
# lfs quota -g 1000 /mnt/testfs
Disk quotas for grp 1000 (gid 1000):
     Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
    /mnt/testfs  102408       0       0       -       3       0       0       -
# 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       -

# fallocate -l 50M /mnt/testfs/projdir/50M
# lfs quota -u 1000 /mnt/testfs
Disk quotas for usr 1000 (uid 1000):
     Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
    /mnt/testfs  102408       0       0       -       4       0       0       -
# lfs quota -g 1000 /mnt/testfs
Disk quotas for grp 1000 (gid 1000):
     Filesystem  kbytes   quota   limit   grace   files   quota   limit   grace
    /mnt/testfs  102408       0       0       -       4       0       0       -
# 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       -

Unmounting and remounting the whole filesystem does not help, I needed to run "e2fsck -fy" on the OSTs in order to update the quota file.



 Comments   
Comment by Andreas Dilger [ 27/Oct/21 ]

This is probably ten times as important to fix for ZFS as it is for ldiskfs, because there isn't really a "quota repair" tool for zfs like e2fsck for ldiskfs.

Comment by Arshad Hussain [ 27/Oct/21 ]

Andreas, thanks for pointing out. I could recreate it in my setup. I am looking into this.

>This is probably ten times as important to fix for ZFS as it is for ldiskfs, because there isn't really a "quota repair" tool for zfs like e2fsck for ldiskfs.

Understood. Will handle this in the ZFS implementation also.

Fail Case:

$ fallocate -l 1M /mnt/lustre/t1
$ lfs quota -u arshad /mnt/lustre
Disk quotas for usr arshad (uid 1000):
Filesystem kbytes quota limit grace files quota limit grace
/mnt/lustre 0 25600 25600 - 0 0 0 -

Pass Case:

$ dd if=/dev/zero of=/mnt/lustre/t7 bs=2M count=1
$ lfs quota -u arshad /mnt/lustre
Disk quotas for usr arshad (uid 1000):
Filesystem kbytes quota limit grace files quota limit grace
/mnt/lustre 2048 25600 25600 - 2 0 0 -
uid 1000 is using default file quota setting

 

Comment by Arshad Hussain [ 27/Oct/21 ]

>... I needed to run "e2fsck -fy" on the OSTs in order to update the quota file.

I could not get this to work on my system. I thought I let you know. Maybe I am doing something wrong.

 

$ umount /mnt/lustre
$ umount /mnt/lustre-mds1
$ umount /mnt/lustre-ost1

$ umount /mnt/lustre-ost2
$ umount /mnt/lustre-ost3
$ e2fsck -fy /tmp/lustre-ost1

$ e2fsck -fy /tmp/lustre-ost2
$ e2fsck -fy /tmp/lustre-ost3

After remounting... Still no update.

$ lfs quota -u arshad /mnt/lustre
Disk quotas for usr arshad (uid 1000):
Filesystem kbytes quota limit grace files quota limit grace
/mnt/lustre 0 25600 25600 - 0 0 0 -

Sample e2fsck run...Done on all osts

 

$ e2fsck -fy /tmp/lustre-ost1
e2fsck 1.45.6.wc5 (09-Feb-2021)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
[QUOTA WARNING] Usage inconsistent for ID 0:actual (2301952, 258) != expected (20480, 2)
Update quota info for quota type 2? yes


lustre-OST0000: ***** FILE SYSTEM WAS MODIFIED *****
lustre-OST0000: 268/100000 files (0.4% non-contiguous), 20245/100000 blocks

 

Comment by Gerrit Updater [ 07/Nov/21 ]

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

Comment by Gerrit Updater [ 13/Dec/21 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/45475/
Subject: LU-15167 quota: fallocate send UID/GID for quota
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 789038c97ae1072874dcd6afcc9cd78e9c885368

Comment by Peter Jones [ 13/Dec/21 ]

Landed for 2.15

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