for (my $count = $linenr; $count <= $lc; $count++) {
my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0));
$fmt =~ s/%%//g;
- if ($fmt =~ /(\%[\*\d\.]*p(?![\WFfSsBKRraEhMmIiUDdgVCbGNO]).)/) {
+ if ($fmt =~ /(\%[\*\d\.]*p(?![\WFfSsBKRraEhMmIiUDdgVCbGNOx]).)/) {
$bad_extension = $1;
last;
}
LASSERT(lqe_is_master(lqe));
+ if (qmt_pool_global(pool))
+ lqe->lqe_is_global = 1;
+
/* read record from disk */
rc = lquota_disk_read(env, pool->qpi_glb_obj[lqe->lqe_site->lqs_qtype],
&lqe->lqe_id, (struct dt_rec *)&qti->qti_glb_rec);
else
lqe->lqe_enforced = true;
- if (qmt_pool_global(pool))
- lqe->lqe_is_global = 1;
-
LQUOTA_DEBUG(lqe, "read");
RETURN(0);
}
* extra reference that is put in qti_lqes_fini */
qpi_getref(lqe2qpi(lqe));
- CDEBUG(D_QUOTA, "LQE %p %lu is added, lqe_cnt %d lqes_num %d\n",
+ CDEBUG(D_QUOTA, "LQE %px %lu is added, lqe_cnt %d lqes_num %d\n",
lqe, (long unsigned)lqe->lqe_id.qid_uid,
qti->qti_lqes_cnt, qti->qti_lqes_num);
LASSERT(qti->qti_lqes_num != 0);
qmt_restore(lqe, &qti_lqes_rstr(env)[0]);
GOTO(out, rc);
}
- } else {
+ } else if (lqe->lqe_is_global) {
ver = dt_version_get(env, LQE_GLB_OBJ(lqe));
}
}
if (rc == 0 && dirtied) {
- qmt_glb_lock_notify(env, lqe, ver);
+ if (lqe->lqe_is_global)
+ qmt_glb_lock_notify(env, lqe, ver);
if (lqe->lqe_id.qid_uid == 0) {
struct qmt_entry_iter_data iter_data;
lqe_write_unlock(lqe);
/* issue glimpse callback to slaves */
- qmt_glimpse_lock(env, qmt, res, &qti->qti_gl_desc,
- qmt_id_lock_cb, lqe);
+ if (lqe->lqe_glbl_data)
+ qmt_glimpse_lock(env, qmt, res, &qti->qti_gl_desc,
+ qmt_id_lock_cb, lqe);
lqe_write_lock(lqe);
if (lqe->lqe_revoke_time == 0 &&
list_del_init(&lqe->lqe_link);
spin_unlock(&qmt->qmt_reba_lock);
- if (!kthread_should_stop())
+ /* lqe_ref == 1 means we hold the last ref,
+ * so no need to send glimpse callbacks.
+ */
+ if (!kthread_should_stop() &&
+ atomic_read(&lqe->lqe_ref) > 1)
qmt_id_lock_glimpse(env, qmt, lqe, NULL);
lqe_putref(lqe);
continue;
}
qti_lqes_add(env, lqe);
- CDEBUG(D_QUOTA, "adding lqe %p from pool %s\n",
+ CDEBUG(D_QUOTA, "adding lqe %px from pool %s\n",
lqe, pos->qpi_name);
}
up_read(&qmt->qmt_pool_lock);
local elapsed
local start_ts=$(date +%s)
- trap cleanup_70c EXIT
+ stack_trap cleanup_70c EXIT
(
while [ ! -e $DIR/replay-single.70c.lck ]; do
test_mkdir -p -c$MDSCOUNT $DIR/$tdir || break
pool_add_targets $qpool2 0 1 ||
error "pool_add_targets failed"
-
$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 \
}
run_test 24 "lfs draws an asterix when limit is reached (b16646)"
+test_25()
+{
+ local limit=10 # 10M
+ local testfile="$DIR/$tdir/$tfile-0"
+ local qpool="qpool1"
+
+ mds_supports_qp
+ setup_quota_test || error "setup quota failed with $?"
+
+ # enable ost quota
+ set_ost_qtype $QTYPE || error "enable ost quota failed"
+
+ $LFS setquota -u $TSTUSR -b 0 -B 50T -i 0 -I 0 $DIR ||
+ error "set user quota failed"
+
+ pool_add $qpool || error "pool_add failed"
+ pool_add_targets $qpool 0 $((OSTCOUNT - 1)) ||
+ error "pool_add_targets failed"
+
+ # increase ost index version to +200
+ for i in {1..200}; do
+ $LFS setquota -u $TSTUSR -B ${i}G --pool $qpool $DIR ||
+ error "set user quota failed"
+ done
+ $LFS setquota -u $TSTUSR -b 0 -B 0 --pool $qpool $DIR ||
+ error "set user quota failed"
+
+ $LFS setquota -u $TSTUSR -B ${limit}M $DIR ||
+ error "set user quota failed"
+
+ local used=$(getquota -u $TSTUSR global curspace)
+ (( used == 0)) || error "Used space($used) for user $TSTUSR isn't 0."
+
+ $LFS setstripe $testfile -c 1 || error "setstripe $testfile failed"
+ chown $TSTUSR.$TSTUSR $testfile || error "chown $testfile failed"
+
+ test_1_check_write $testfile "user" $limit
+ return 0
+}
+run_test 25 "check indexes versions"
+
test_27a() { # b19612
$LFS quota $TSTUSR $DIR &&
error "lfs succeeded with no type, but should have failed"