Whamcloud - gitweb
LU-14535 quota: get all quota info in LFS
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 2 Feb 2024 05:58:59 +0000 (13:58 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 6 Jun 2024 08:35:34 +0000 (08:35 +0000)
commit76b0edaac6b07e566925ae7de6ae7fb7741f0f95
tree36fd0e9fc46b3ac4cb4719707fcaead3fbc75a05
parentea911335f5dcd95979bfff0a81ad775fb405ebc9
LU-14535 quota: get all quota info in LFS

This patch adds option "-a" for LFS to get the quota info of
all quota IDs. it iterates quota setting saved in global quota
setting files "quota_master/md-0x0" and "quota_master/dt-0x0"
from QMT and iterates the quota usage info saved in acct quota
files in the backend FS (LDiskFS or ZFS) from QSDs, then merge
the two kinds of quota info at client and print it in the similar
way as "lfs quota -u|-g|-p".

  $lfs quota -a -u /mnt/lustre
  Filesystem /mnt/lustre, Disk usr quotas
  quota_id  kbytes   quota   limit   grace   files quota limit  grace
      root    9684       0       0       -    1019    0     0       -
       bin       4       0  102400       -       1    0  10240      -
    daemon       4       0  102400       -       1    0  10240      -
       adm       4       0  102400       -       1    0  10240      -
        lp       4       0  102400       -       1    0  10240      -
      sync       4       0  102400       -       1    0  10240      -
  shutdown       4       0  102400       -       1    0  10240      -
      halt       4       0  102400       -       1    0  10240      -
      mail       4       0  102400       -       1    0  10240      -

  $lfs quota -a -g /mnt/lustre
  Filesystem /mnt/lustre, Disk grp quotas
  quota_id  kbytes   quota   limit   grace   files quota limit  grace
      root    9684       0       0       -    1019    0      0      -
       bin       4       0  204800       -       1    0  20480      -
    daemon       4       0  204800       -       1    0  20480      -
       adm       4       0  204800       -       1    0  20480      -
        lp       4       0  204800       -       1    0  20480      -
      sync       4       0  204800       -       1    0  20480      -
  shutdown       4       0  204800       -       1    0  20480      -
      halt       4       0  204800       -       1    0  20480      -
      mail       4       0  204800       -       1    0  20480      -

Lustre-change: https://review.whamcloud.com/42098
Lustre-commit: 3edc71803af3b4dc672313cd1ba395de724fbc59

Test-Parameters: testlist=sanity-quota env=SLOW=yes,ONLY=49,NUM_QIDS=20000
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Change-Id: I08feb928fbf34635ec9c5c341de993c718798dc9
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/46328
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
26 files changed:
contrib/scripts/checkpatch.pl
lustre/doc/lfs-quota.1
lustre/include/lustre_quota.h
lustre/include/lustre_req_layout.h
lustre/include/obd_class.h
lustre/include/obd_support.h
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/include/uapi/linux/lustre/lustre_user.h
lustre/llite/dir.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/super25.c
lustre/lmv/lmv_obd.c
lustre/lov/lov_obd.c
lustre/mdc/mdc_request.c
lustre/mdt/mdt_handler.c
lustre/ofd/ofd_dev.c
lustre/osc/osc_quota.c
lustre/ptlrpc/layout.c
lustre/quota/lquota_internal.h
lustre/quota/lquota_lib.c
lustre/quota/qmt_handler.c
lustre/target/tgt_handler.c
lustre/tests/createmany.c
lustre/tests/sanity-quota.sh
lustre/utils/lfs.c