seq_printf(p, "global_pool%d_%s_%s\n", poolid,
RES_NAME(rtype), QTYPE_NAME(qtype));
+ } else if (fid_seq(fid) == FID_SEQ_LOCAL_NAME) {
+ /* global index copy object */
+ seq_printf(p, "global_index_copy:\n");
} else {
return -ENOTSUPP;
}
"u }\n", "usage:",
((struct lquota_acct_rec *)rec)->ispace,
toqb(((struct lquota_acct_rec *)rec)->bspace));
- else if (fid_seq(fid) == FID_SEQ_QUOTA_GLB)
+ else if (fid_seq(fid) == FID_SEQ_QUOTA_GLB ||
+ fid_seq(fid) == FID_SEQ_LOCAL_NAME)
seq_printf(p, " %-8s { hard: %20"LPF64"u, soft: %20"LPF64
"u, granted: %20"LPF64"u, time: %20"LPF64"u }\n",
"limits:",
GOTO(out, rc = PTR_ERR(qqi->qqi_site));
}
- /* register proc entry for accounting object */
+ /* register proc entry for accounting & global index copy objects */
rc = lprocfs_seq_create(qsd->qsd_proc,
qtype == USRQUOTA ? "acct_user" : "acct_group",
0444, &lprocfs_quota_seq_fops,
qsd->qsd_svname, rc);
GOTO(out, rc);
}
+
+ rc = lprocfs_seq_create(qsd->qsd_proc,
+ qtype == USRQUOTA ? "limit_user" : "limit_group",
+ 0444, &lprocfs_quota_seq_fops,
+ qqi->qqi_glb_obj);
+ if (rc) {
+ CERROR("%s: can't add procfs entry for global index copy %d\n",
+ qsd->qsd_svname, rc);
+ GOTO(out, rc);
+ }
EXIT;
out:
if (rc)
}
run_test 7c "Quota reintegration (restart mds during reintegration)"
+# Quota reintegration (Transfer index in multiple bulks)
+test_7d(){
+ local TESTFILE=$DIR/$tdir/$tfile
+ local TESTFILE1="$DIR/$tdir/$tfile"-1
+ local limit=20 #20M
+
+ setup_quota_test
+ trap cleanup_quota_test EXIT
+
+ set_ost_qtype "none" || error "disable ost quota failed"
+ $LFS setquota -u $TSTUSR -B ${limit}M $DIR
+ $LFS setquota -u $TSTUSR2 -B ${limit}M $DIR
+
+ #define OBD_FAIL_OBD_IDX_READ_BREAK 0x608
+ lustre_fail mds 0x608 0
+
+ # enable quota to tirgger reintegration
+ set_ost_qtype "u" || error "enable ost quota failed"
+ wait_ost_reint "u" || error "reintegration failed"
+
+ lustre_fail mds 0
+
+ # hardlimit should have been fetched by slave during global
+ # reintegration, write will exceed quota
+ $RUNAS $DD of=$TESTFILE count=$((limit + 1)) oflag=sync &&
+ quota_error u $TSTUSR "$TSTUSR write success, expect EDQUOT"
+
+ $RUNAS2 $DD of=$TESTFILE1 count=$((limit + 1)) oflag=sync &&
+ quota_error u $TSTUSR2 "$TSTUSR2 write success, expect EDQUOT"
+
+ cleanup_quota_test
+ resetquota -u $TSTUSR
+ resetquota -u $TSTUSR2
+}
+run_test 7d "Quota reintegration (Transfer index in multiple bulks)"
+
# run dbench with quota enabled
test_8() {
local BLK_LIMIT="100g" #100G
local proc="qmt.*.md-0x0.glb-usr"
id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 401 ] || error "Migrate inode user limit failed: $id_cnt"
+ [ $id_cnt -eq 403 ] || error "Migrate inode user limit failed: $id_cnt"
limit=$(getquota -u 1 global isoftlimit)
[ $limit -eq 1024 ] || error "User inode softlimit: $limit"
limit=$(getquota -u 1 global ihardlimit)
proc="qmt.*.md-0x0.glb-grp"
id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 401 ] || error "Migrate inode group limit failed: $id_cnt"
+ [ $id_cnt -eq 403 ] || error "Migrate inode group limit failed: $id_cnt"
limit=$(getquota -g 1 global isoftlimit)
[ $limit -eq 1024 ] || error "Group inode softlimit: $limit"
limit=$(getquota -g 1 global ihardlimit)
proc=" qmt.*.dt-0x0.glb-usr"
id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 401 ] || error "Migrate block user limit failed: $id_cnt"
+ [ $id_cnt -eq 403 ] || error "Migrate block user limit failed: $id_cnt"
limit=$(getquota -u 60001 global bsoftlimit)
[ $limit -eq 10485760 ] || error "User block softlimit: $limit"
limit=$(getquota -u 60001 global bhardlimit)
proc="qmt.*.dt-0x0.glb-grp"
id_cnt=$(do_node $mdt0_node $LCTL get_param -n $proc | wc -l)
- [ $id_cnt -eq 401 ] || error "Migrate block user limit failed: $id_cnt"
+ [ $id_cnt -eq 403 ] || error "Migrate block user limit failed: $id_cnt"
limit=$(getquota -g 60001 global bsoftlimit)
[ $limit -eq 10485760 ] || error "Group block softlimit: $limit"
limit=$(getquota -g 60001 global bhardlimit)