The use of "lfs setquota -o" as the short option for
specifying the quota pool is confusing, because "lfs quota -o"
is the short option for getting quota on an OST. Use only
long option --pool for lfs setquota.
Patch also changes -o with --pool for setquota in
sanity-quota.sh
Change-Id: I18a695dcbbcd668611b1301c48f4e10d354b2686
Signed-off-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-on: https://review.whamcloud.com/39715
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
pool_add_targets $qpool 0 $(($OSTCOUNT - 1)) ||
error "pool_add_targets failed"
pool_add_targets $qpool 0 $(($OSTCOUNT - 1)) ||
error "pool_add_targets failed"
- $LFS setquota -u $TSTUSR -B ${limit}M -o $qpool $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit}M --pool $qpool $DIR ||
error "set user quota failed"
# make sure the system is clean
error "set user quota failed"
# make sure the system is clean
$LFS setquota -g $TSTUSR -b 0 -B ${global_limit}M -i 0 -I 0 $DIR ||
error "set group quota failed"
$LFS setquota -g $TSTUSR -b 0 -B ${global_limit}M -i 0 -I 0 $DIR ||
error "set group quota failed"
- $LFS setquota -g $TSTUSR -b 0 -B ${limit}M -o $qpool $DIR ||
+ $LFS setquota -g $TSTUSR -b 0 -B ${limit}M --pool $qpool $DIR ||
error "set group quota failed"
testfile="$DIR/$tdir/$tfile-1"
error "set group quota failed"
testfile="$DIR/$tdir/$tfile-1"
$LFS setquota -p $TSTPRJID -b 0 -B ${global_limit}M -i 0 -I 0 $DIR ||
error "set project quota failed"
$LFS setquota -p $TSTPRJID -b 0 -B ${global_limit}M -i 0 -I 0 $DIR ||
error "set project quota failed"
- $LFS setquota -p $TSTPRJID -b 0 -B ${limit}M -o $qpool $DIR ||
+ $LFS setquota -p $TSTPRJID -b 0 -B ${limit}M --pool $qpool $DIR ||
error "set project quota failed"
error "set project quota failed"
# create pools without hard limit
# initially such case raised several bugs
# create pools without hard limit
# initially such case raised several bugs
- $LFS setquota -u $TSTUSR -B 0M -o $qpool1 $DIR ||
+ $LFS setquota -u $TSTUSR -B 0M --pool $qpool1 $DIR ||
error "set user quota failed"
error "set user quota failed"
- $LFS setquota -u $TSTUSR -B 0M -o $qpool2 $DIR ||
+ $LFS setquota -u $TSTUSR -B 0M --pool $qpool2 $DIR ||
error "set user quota failed"
# make sure the system is clean
error "set user quota failed"
# make sure the system is clean
pool_add_targets $qpool2 0 $(($OSTCOUNT - 1)) ||
error "pool_add_targets failed"
pool_add_targets $qpool2 0 $(($OSTCOUNT - 1)) ||
error "pool_add_targets failed"
- $LFS setquota -u $TSTUSR -B ${limit1}M -o $qpool1 $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit1}M --pool $qpool1 $DIR ||
error "set user quota failed"
error "set user quota failed"
- $LFS setquota -u $TSTUSR -B ${limit2}M -o $qpool2 $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit2}M --pool $qpool2 $DIR ||
error "set user quota failed"
# make sure the system is clean
error "set user quota failed"
# make sure the system is clean
pool_add_targets $qpool1 1 1 ||
error "pool_add_targets failed"
pool_add_targets $qpool1 1 1 ||
error "pool_add_targets failed"
- $LFS setquota -u $TSTUSR -B ${limit1}M -o $qpool1 $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit1}M --pool $qpool1 $DIR ||
error "set user quota failed"
# make sure the system is clean
error "set user quota failed"
# make sure the system is clean
pool_add_targets $qpool1 0 0 ||
error "pool_add_targets failed"
pool_add_targets $qpool1 0 0 ||
error "pool_add_targets failed"
- $LFS setquota -u $TSTUSR -B ${limit1}M -o $qpool1 $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit1}M --pool $qpool1 $DIR ||
error "set user quota failed"
# make sure the system is clean
error "set user quota failed"
# make sure the system is clean
pool_add_targets $qpool 0 $(($OSTCOUNT - 1)) ||
error "pool_add_targets failed"
pool_add_targets $qpool 0 $(($OSTCOUNT - 1)) ||
error "pool_add_targets failed"
- $LFS setquota -u $TSTUSR -B ${limit}M -o $qpool $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit}M --pool $qpool $DIR ||
error "set user quota failed"
# make sure the system is clean
error "set user quota failed"
# make sure the system is clean
$LFS setquota -t -u --block-grace $glbl_grace --inode-grace \
$MAX_IQ_TIME $DIR || error "set user grace time failed"
$LFS setquota -t -u --block-grace $grace \
$LFS setquota -t -u --block-grace $glbl_grace --inode-grace \
$MAX_IQ_TIME $DIR || error "set user grace time failed"
$LFS setquota -t -u --block-grace $grace \
- -o $qpool $DIR || error "set user grace time failed"
+ --pool $qpool $DIR || error "set user grace time failed"
$LFS setquota -u $TSTUSR -b ${glbl_limit}M -B 0 -i 0 -I 0 $DIR ||
error "set user quota failed"
$LFS setquota -u $TSTUSR -b ${glbl_limit}M -B 0 -i 0 -I 0 $DIR ||
error "set user quota failed"
- $LFS setquota -u $TSTUSR -b ${limit}M -B 0 -o $qpool $DIR ||
+ $LFS setquota -u $TSTUSR -b ${limit}M -B 0 --pool $qpool $DIR ||
error "set user quota failed"
test_block_soft $testfile $grace $limit "u" $qpool
error "set user quota failed"
test_block_soft $testfile $grace $limit "u" $qpool
$LFS setquota -t -g --block-grace $glbl_grace --inode-grace \
$MAX_IQ_TIME $DIR || error "set group grace time failed"
$LFS setquota -t -g --block-grace $grace \
$LFS setquota -t -g --block-grace $glbl_grace --inode-grace \
$MAX_IQ_TIME $DIR || error "set group grace time failed"
$LFS setquota -t -g --block-grace $grace \
- -o $qpool $DIR || error "set group grace time failed"
+ --pool $qpool $DIR || error "set group grace time failed"
$LFS setquota -g $TSTUSR -b ${glbl_limit}M -B 0 -i 0 -I 0 $DIR ||
error "set group quota failed"
$LFS setquota -g $TSTUSR -b ${glbl_limit}M -B 0 -i 0 -I 0 $DIR ||
error "set group quota failed"
- $LFS setquota -g $TSTUSR -b ${limit}M -B 0 -o $qpool $DIR ||
+ $LFS setquota -g $TSTUSR -b ${limit}M -B 0 --pool $qpool $DIR ||
error "set group quota failed"
test_block_soft $testfile $grace $limit "g" $qpool
error "set group quota failed"
test_block_soft $testfile $grace $limit "g" $qpool
$MAX_IQ_TIME $DIR ||
error "set project grace time failed"
$LFS setquota -t -p --block-grace $grace \
$MAX_IQ_TIME $DIR ||
error "set project grace time failed"
$LFS setquota -t -p --block-grace $grace \
- -o $qpool $DIR || error "set project grace time failed"
+ --pool $qpool $DIR ||
+ error "set project grace time failed"
$LFS setquota -p $TSTPRJID -b ${glbl_limit}M -B 0 -i 0 -I 0 \
$DIR || error "set project quota failed"
$LFS setquota -p $TSTPRJID -b ${glbl_limit}M -B 0 -i 0 -I 0 \
$DIR || error "set project quota failed"
- $LFS setquota -p $TSTPRJID -b ${limit}M -B 0 -o $qpool $DIR ||
- error "set project quota failed"
+ $LFS setquota -p $TSTPRJID -b ${limit}M -B 0 \
+ --pool $qpool $DIR || error "set project quota failed"
test_block_soft $testfile $grace $limit "p" $qpool
resetquota -p $TSTPRJID
$LFS setquota -t -p --block-grace $MAX_DQ_TIME --inode-grace \
$MAX_IQ_TIME $DIR ||
error "restore project grace time failed"
test_block_soft $testfile $grace $limit "p" $qpool
resetquota -p $TSTPRJID
$LFS setquota -t -p --block-grace $MAX_DQ_TIME --inode-grace \
$MAX_IQ_TIME $DIR ||
error "restore project grace time failed"
- $LFS setquota -t -p --block-grace $MAX_DQ_TIME -o $qpool $DIR ||
- error "set project grace time failed"
+ $LFS setquota -t -p --block-grace $MAX_DQ_TIME --pool $qpool \
+ $DIR || error "set project grace time failed"
fi
# cleanup
$LFS setquota -t -u --block-grace $MAX_DQ_TIME --inode-grace \
$MAX_IQ_TIME $DIR || error "restore user grace time failed"
$LFS setquota -t -u --block-grace $MAX_DQ_TIME \
fi
# cleanup
$LFS setquota -t -u --block-grace $MAX_DQ_TIME --inode-grace \
$MAX_IQ_TIME $DIR || error "restore user grace time failed"
$LFS setquota -t -u --block-grace $MAX_DQ_TIME \
- -o $qpool $DIR || error "restore user grace time failed"
+ --pool $qpool $DIR || error "restore user grace time failed"
$LFS setquota -t -g --block-grace $MAX_DQ_TIME --inode-grace \
$MAX_IQ_TIME $DIR || error "restore group grace time failed"
$LFS setquota -t -g --block-grace $MAX_DQ_TIME \
$LFS setquota -t -g --block-grace $MAX_DQ_TIME --inode-grace \
$MAX_IQ_TIME $DIR || error "restore group grace time failed"
$LFS setquota -t -g --block-grace $MAX_DQ_TIME \
- -o $qpool $DIR || error "restore group grace time failed"
+ --pool $qpool $DIR || error "restore group grace time failed"
}
run_test 3b "Quota pools: Block soft limit (start timer, expires, stop timer)"
}
run_test 3b "Quota pools: Block soft limit (start timer, expires, stop timer)"
$LFS setquota -t -u --block-grace $glbl_grace --inode-grace \
$MAX_IQ_TIME $DIR || error "set user grace time failed"
$LFS setquota -t -u --block-grace $grace1 \
$LFS setquota -t -u --block-grace $glbl_grace --inode-grace \
$MAX_IQ_TIME $DIR || error "set user grace time failed"
$LFS setquota -t -u --block-grace $grace1 \
- -o $qpool $DIR || error "set user grace time failed"
+ --pool $qpool $DIR || error "set user grace time failed"
$LFS setquota -t -u --block-grace $grace2 \
$LFS setquota -t -u --block-grace $grace2 \
- -o $qpool2 $DIR || error "set user grace time failed"
+ --pool $qpool2 $DIR || error "set user grace time failed"
$LFS setquota -u $TSTUSR -b ${glbl_limit}M -B 0 -i 0 -I 0 $DIR ||
error "set user quota failed"
$LFS setquota -u $TSTUSR -b ${glbl_limit}M -B 0 -i 0 -I 0 $DIR ||
error "set user quota failed"
- $LFS setquota -u $TSTUSR -b ${limit}M -B 0 -o $qpool $DIR ||
+ $LFS setquota -u $TSTUSR -b ${limit}M -B 0 --pool $qpool $DIR ||
error "set user quota failed"
# qpool has minimum soft limit, but it's grace is grater than
# grace period of qpool2. Thus write shouldn't fail when
# hit qpool soft limit - only when reaches up qpool2 limit
# after grace2 seconds.
error "set user quota failed"
# qpool has minimum soft limit, but it's grace is grater than
# grace period of qpool2. Thus write shouldn't fail when
# hit qpool soft limit - only when reaches up qpool2 limit
# after grace2 seconds.
- $LFS setquota -u $TSTUSR -b ${limit2}M -B 0 -o $qpool2 $DIR ||
+ $LFS setquota -u $TSTUSR -b ${limit2}M -B 0 --pool $qpool2 $DIR ||
error "set user quota failed"
test_block_soft $testfile $grace2 $limit2 "u" $qpool2
error "set user quota failed"
test_block_soft $testfile $grace2 $limit2 "u" $qpool2
$LFS setquota -t -u --block-grace $MAX_DQ_TIME --inode-grace \
$MAX_IQ_TIME $DIR || error "restore user grace time failed"
$LFS setquota -t -u --block-grace $MAX_DQ_TIME \
$LFS setquota -t -u --block-grace $MAX_DQ_TIME --inode-grace \
$MAX_IQ_TIME $DIR || error "restore user grace time failed"
$LFS setquota -t -u --block-grace $MAX_DQ_TIME \
- -o $qpool $DIR || error "restore user grace time failed"
+ --pool $qpool $DIR || error "restore user grace time failed"
$LFS setquota -t -u --block-grace $MAX_DQ_TIME \
$LFS setquota -t -u --block-grace $MAX_DQ_TIME \
- -o $qpool2 $DIR || error "restore user grace time failed"
+ --pool $qpool2 $DIR || error "restore user grace time failed"
}
run_test 3c "Quota pools: check block soft limit on different pools"
}
run_test 3c "Quota pools: check block soft limit on different pools"
error "set user quota failed"
log "User quota (block hardlimit:$limit MB)"
error "set user quota failed"
log "User quota (block hardlimit:$limit MB)"
- $LFS setquota -u $TSTUSR -B ${limit}M -o $qpool $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit}M --pool $qpool $DIR ||
error "set user quota failed"
$RUNAS dd if=/dev/zero of="$dom0/f1" bs=1K count=512 oflag=sync ||
error "set user quota failed"
$RUNAS dd if=/dev/zero of="$dom0/f1" bs=1K count=512 oflag=sync ||
pool_add $qpool || error "pool_add failed"
pool_add_targets $qpool 0 0 || error "pool_add_targets failed"
pool_add $qpool || error "pool_add failed"
pool_add_targets $qpool 0 0 || error "pool_add_targets failed"
- $LFS setquota -u $TSTUSR -B ${limit}M -o $qpool $DIR
+ $LFS setquota -u $TSTUSR -B ${limit}M --pool $qpool $DIR
rc=$?
[ $rc -eq $err ] || error "setquota res $rc != $err"
rc=$?
[ $rc -eq $err ] || error "setquota res $rc != $err"
pool_add_targets $qpool 0 1 ||
error "pool_add_targets failed"
pool_add_targets $qpool 0 1 ||
error "pool_add_targets failed"
- $LFS setquota -u $TSTUSR -B ${limit}M -o $qpool $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit}M --pool $qpool $DIR ||
error "set user quota failed"
pool_add $qpool2 || error "pool_add failed"
pool_add_targets $qpool2 1 1 ||
error "pool_add_targets failed"
error "set user quota failed"
pool_add $qpool2 || error "pool_add failed"
pool_add_targets $qpool2 1 1 ||
error "pool_add_targets failed"
- $LFS setquota -u $TSTUSR -B ${limit}M -o $qpool2 $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit}M --pool $qpool2 $DIR ||
error "set user quota failed"
# make sure the system is clean
error "set user quota failed"
# make sure the system is clean
pool_add_targets $qpool 0 1 ||
error "pool_add_targets failed"
pool_add_targets $qpool 0 1 ||
error "pool_add_targets failed"
- $LFS setquota -u $TSTUSR -B ${limit1}M -o $qpool $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit1}M --pool $qpool $DIR ||
error "set user quota failed"
pool_add $qpool2 || error "pool_add failed"
pool_add_targets $qpool2 1 1 ||
error "pool_add_targets failed"
error "set user quota failed"
pool_add $qpool2 || error "pool_add failed"
pool_add_targets $qpool2 1 1 ||
error "pool_add_targets failed"
- $LFS setquota -u $TSTUSR -B ${limit2}M -o $qpool2 $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit2}M --pool $qpool2 $DIR ||
error "set user quota failed"
# make sure the system is clean
error "set user quota failed"
# make sure the system is clean
pool_add $qpool || error "pool_add failed"
pool_add_targets $qpool 1 1 || error "pool_add_targets failed"
pool_add $qpool || error "pool_add failed"
pool_add_targets $qpool 1 1 || error "pool_add_targets failed"
- $LFS setquota -u $TSTUSR -B ${limit}M -o $qpool $DIR ||
+ $LFS setquota -u $TSTUSR -B ${limit}M --pool $qpool $DIR ||
error "set user quota failed"
# make sure the system is clean
error "set user quota failed"
# make sure the system is clean
{ .val = 'p', .name = "projid", .has_arg = no_argument },
{ .val = 't', .name = "times", .has_arg = no_argument },
{ .val = 'u', .name = "user", .has_arg = no_argument },
{ .val = 'p', .name = "projid", .has_arg = no_argument },
{ .val = 't', .name = "times", .has_arg = no_argument },
{ .val = 'u', .name = "user", .has_arg = no_argument },
- { .val = 'o', .name = "pool", .has_arg = required_argument },
+ { .val = LFS_POOL_OPT,
+ .name = "pool", .has_arg = required_argument },
{ .name = NULL } };
int qtype;
qctl->qc_cmd = LUSTRE_Q_SETINFO;
qctl->qc_type = ALLQUOTA;
{ .name = NULL } };
int qtype;
qctl->qc_cmd = LUSTRE_Q_SETINFO;
qctl->qc_type = ALLQUOTA;
- while ((c = getopt_long(argc, argv, "b:gi:ptuo:",
+ while ((c = getopt_long(argc, argv, "b:gi:ptu",
long_opts, NULL)) != -1) {
switch (c) {
case 'u':
long_opts, NULL)) != -1) {
switch (c) {
case 'u':
break;
case 't': /* Yes, of course! */
break;
break;
case 't': /* Yes, of course! */
break;
if (lfs_verify_poolarg(optarg))
return -1;
fprintf(stdout,
if (lfs_verify_poolarg(optarg))
return -1;
fprintf(stdout,
{ .val = 'P', .name = "default-prj", .has_arg = no_argument },
{ .val = 'u', .name = "user", .has_arg = required_argument },
{ .val = 'U', .name = "default-usr", .has_arg = no_argument },
{ .val = 'P', .name = "default-prj", .has_arg = no_argument },
{ .val = 'u', .name = "user", .has_arg = required_argument },
{ .val = 'U', .name = "default-usr", .has_arg = no_argument },
- { .val = 'o', .name = "pool", .has_arg = required_argument },
+ { .val = LFS_POOL_OPT,
+ .name = "pool", .has_arg = required_argument },
{ .name = NULL } };
unsigned int limit_mask = 0;
bool use_default = false;
{ .name = NULL } };
unsigned int limit_mask = 0;
bool use_default = false;
* isn't reinitialized from command line
*/
* isn't reinitialized from command line
*/
- while ((c = getopt_long(argc, argv, "b:B:dg:Gi:I:p:Pu:Uo:",
+ while ((c = getopt_long(argc, argv, "b:B:dg:Gi:I:p:Pu:U",
long_opts, NULL)) != -1) {
switch (c) {
case 'U':
long_opts, NULL)) != -1) {
switch (c) {
case 'U':
(unsigned long long)dqb->dqb_ihardlimit,
progname);
break;
(unsigned long long)dqb->dqb_ihardlimit,
progname);
break;
if (lfs_verify_poolarg(optarg)) {
rc = -1;
goto out;
if (lfs_verify_poolarg(optarg)) {
rc = -1;
goto out;
bool show_default = false;
int qtype;
struct option long_opts[] = {
bool show_default = false;
int qtype;
struct option long_opts[] = {
- { .val = 1, .name = "pool", .has_arg = required_argument },
+ { .val = LFS_POOL_OPT, .name = "pool", .has_arg = required_argument },
{ .name = NULL } };
qctl = calloc(1, sizeof(*qctl) + LOV_MAXPOOLNAME + 1);
{ .name = NULL } };
qctl = calloc(1, sizeof(*qctl) + LOV_MAXPOOLNAME + 1);
case 'h':
human_readable = true;
break;
case 'h':
human_readable = true;
break;
if (lfs_verify_poolarg(optarg)) {
rc = -1;
goto out;
if (lfs_verify_poolarg(optarg)) {
rc = -1;
goto out;