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>
}
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)) \
}
}
+ 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",