From: Sergey Cheremencev Date: Wed, 9 Oct 2024 22:19:23 +0000 (+0300) Subject: LU-18353 utils: prohibit set inode limit to PQ X-Git-Tag: 2.16.52~102 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=3d838a1b37e57b028fa1f7a55a32e16eb75e7c80;p=fs%2Flustre-release.git LU-18353 utils: prohibit set inode limit to PQ 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 Change-Id: If3fae3cee49138b47605bc603e896955f9b73851 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56634 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Alexander Boyko Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index c2144ef..2548d02 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -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)) \ diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 5294ace..4a55370e 100755 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -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",