qti->qti_lqes_num * sizeof(struct lquota_entry *));
qti->qti_lqes_num = 0;
+ qti->qti_lqes_cnt = 0;
}
int qti_lqes_min_qunit(const struct lu_env *env)
{
int rc = 0;
- if (qti_lqes_cnt(env) > QMT_MAX_POOL_NUM) {
+ if (qti_lqes_inited(env) && qti_lqes_cnt(env) > QMT_MAX_POOL_NUM) {
OBD_ALLOC(qmt_info(env)->qti_lqes_rstr,
qti_lqes_cnt(env) * sizeof(struct qmt_lqe_restore));
if (!qti_lqes_rstr(env))
void qti_lqes_restore_fini(const struct lu_env *env)
{
- if (qti_lqes_cnt(env) > QMT_MAX_POOL_NUM)
+ if (qti_lqes_inited(env) && qti_lqes_cnt(env) > QMT_MAX_POOL_NUM)
OBD_FREE(qmt_info(env)->qti_lqes_rstr,
qti_lqes_cnt(env) * sizeof(struct qmt_lqe_restore));
}
lqe_write_unlock(lqe);
out_nolock:
- qti_lqes_restore_fini(env);
- if (th != NULL && !IS_ERR(th))
- dt_trans_stop(env, qmt->qmt_child, th);
+ if (!is_updated) {
+ if (th != NULL && !IS_ERR(th))
+ dt_trans_stop(env, qmt->qmt_child, th);
+ qti_lqes_restore_fini(env);
+ }
if (rc == 0 && dirtied) {
qmt_glb_lock_notify(env, lqe, ver);