lqe_gl = lqe->lqe_is_global ? lqe : NULL;
rc = qmt_pool_lqes_lookup_spec(env, qmt, lqe_rtype(lqe),
lqe_qtype(lqe), &lqe->lqe_id);
- if (!qti_lqes_cnt(env))
+ if (rc)
GOTO(lqes_fini, rc);
if (!lqe_gl && qti_lqes_glbl(env)->lqe_is_global)
{
struct qmt_pool_info *pos;
struct lquota_entry *lqe;
- int rc = 0;
qti_lqes_init(env);
down_read(&qmt->qmt_pool_lock);
/* ENOENT is valid case for lqe from non global pool
* that hasn't limits, i.e. not enforced. Continue even
* in case of error - we can handle already found lqes */
- if (IS_ERR_OR_NULL(lqe)) {
- /* let know that something went wrong */
- rc = lqe ? PTR_ERR(lqe) : -ENOENT;
+ if (IS_ERR(lqe))
continue;
- }
if (!lqe->lqe_enforced) {
/* no settings for this qid_uid */
lqe_putref(lqe);
lqe, pos->qpi_name);
}
up_read(&qmt->qmt_pool_lock);
- RETURN(rc);
+ RETURN(qti_lqes_cnt(env) ? 0 : -ENOENT);
}
/**
}
run_test 13 "Cancel per-ID lock in the LRU list"
+test_14()
+{
+ local qpool="qpool1"
+ local tfile1="$DIR/$tdir/$tfile-0"
+
+ 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 100M -i 0 -I 0 $DIR ||
+ error "set user quota failed"
+ pool_add $qpool || error "pool_add failed"
+ pool_add_targets $qpool 0 ||
+ error "pool_add_targets failed"
+ $LFS setstripe -p $qpool $DIR/$tdir || error "cannot set stripe"
+ $LFS setquota -u $TSTUSR -B 30M --pool $qpool $DIR ||
+ error "set user quota failed"
+
+ # don't care about returned value
+ $RUNAS $DD of=$tfile1 count=10 oflag=direct
+
+ echo "Stop ost1..."
+ stop ost1
+ $LFS setquota -u $TSTUSR -b 0 -B 0 -i 0 -I 0 $DIR ||
+ error "set user quota failed"
+
+ # no panic after removing OST0000 from the pool
+ pool_remove_target $qpool 0
+ start ost1 $(ostdevname 1) $OST_MOUNT_OPTS || error "start ost1 failed"
+}
+run_test 14 "check panic in qmt_site_recalc_cb"
+
test_15(){
local LIMIT=$((24 * 1024 * 1024 * 1024 * 1024)) # 24 TB