Whamcloud - gitweb
LU-18353 utils: prohibit set inode limit to PQ 34/56634/4
authorSergey Cheremencev <scherementsev@ddn.com>
Wed, 9 Oct 2024 22:19:23 +0000 (01:19 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 18 Jan 2025 22:04:19 +0000 (22:04 +0000)
Prohibit to set inode limit for Pool Quotas.
Without the fix it sent a request at MDT and
failed with following errors:

  lfs setquota: Cannot find pool 'ddn_ssd'
  lfs setquota: quotactl failed: No such file or directory

With the patch it fails with more suitable message
and returns ENOENT directly from utils without extra
request at MDT:

  lt-lfs setquota: inode limits are not supported with Pool Quotas
  setquota failed: Invalid argument

Test-Parameters: trivial testlist=sanity-quota
Signed-off-by: Sergey Cheremencev <scherementsev@ddn.com>
Change-Id: If3fae3cee49138b47605bc603e896955f9b73851
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56634
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-quota.sh
lustre/utils/lfs.c

index c2144ef..2548d02 100755 (executable)
@@ -6586,6 +6586,21 @@ test_91()
 }
 run_test 91 "new quota index files in quota_master"
 
+test_92()
+{
+       local qpool="qpool1"
+       pool_add $qpool || error "pool_add failed"
+
+       # with the fix it returns EINVAL instead of ENOENT
+       $LFS setquota -u $TSTUSR -B 100M -I 0 --pool $qpool $MOUNT
+       (( $? == 22 )) || error "inode hard limit should be prohibited with PQ"
+       $LFS setquota -u $TSTUSR -B 100M -i 0 --pool $qpool $MOUNT
+       (( $? == 22 )) || error "inode soft limit should be prohibited with PQ"
+       $LFS setquota -u $TSTUSR -B 100M -I 0 -i 10M --pool $qpool $MOUNT
+       (( $? == 22 )) || error "inode limits should be prohibited with PQ"
+}
+run_test 92 "Cannot set inode limit with Quota Pools"
+
 quota_fini()
 {
        do_nodes $(comma_list $(nodes_list)) \
index 5294ace..4a55370 100755 (executable)
@@ -8891,6 +8891,15 @@ quota_type_def:
                }
        }
 
+       if (LUSTRE_Q_CMD_IS_POOL(qctl->qc_cmd) &&
+           limit_mask & (IHLIMIT | ISLIMIT)) {
+               fprintf(stderr,
+                       "%s setquota: inode limits are not supported with Pool Quotas\n",
+                       progname);
+               rc = -EINVAL;
+               goto out;
+       }
+
        if (qctl->qc_type == ALLQUOTA) {
                fprintf(stderr,
                        "%s setquota: either -u or -g must be specified\n",