Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-15167

fallocate does not increase quota usage

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.15.0
    • None
    • None
    • 3
    • 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.

      Attachments

        Issue Links

          Activity

            [LU-15167] fallocate does not increase quota usage
            pjones Peter Jones added a comment -

            Landed for 2.15

            pjones Peter Jones added a comment - Landed for 2.15

            "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

            gerrit Gerrit Updater added a comment - "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

            "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

            gerrit Gerrit Updater added a comment - "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

            >... 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
            

             

            arshad512 Arshad Hussain added a comment - >... 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  

            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

             

            arshad512 Arshad Hussain added a comment - 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  

            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.

            adilger Andreas Dilger added a comment - 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.

            People

              arshad512 Arshad Hussain
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: