spin_lock(&qctxt->lqc_lock);
qctxt->lqc_import = NULL;
spin_unlock(&qctxt->lqc_lock);
+ ptlrpc_cleanup_imp(exp->exp_imp_reverse);
+ dqacq_interrupt(qctxt);
CDEBUG(D_QUOTA, "%s: lqc_import of obd(%p) is invalid now.\n",
obd->obd_name, obd);
}
lqs->lqs_iwrite_pending += *pending;
}
}
+
+ /* if xx_rec < 0, that means quota are releasing,
+ * and it may return before we use quota. So if
+ * we find this situation, we assuming it has
+ * returned b=18491 */
+ if (isblk && lqs->lqs_blk_rec < 0) {
+ if (qdata[i].qd_count < -lqs->lqs_blk_rec)
+ qdata[i].qd_count = 0;
+ else
+ qdata[i].qd_count += lqs->lqs_blk_rec;
+ }
+ if (!isblk && lqs->lqs_ino_rec < 0) {
+ if (qdata[i].qd_count < -lqs->lqs_ino_rec)
+ qdata[i].qd_count = 0;
+ else
+ qdata[i].qd_count += lqs->lqs_ino_rec;
+ }
+
+
+ CDEBUG(D_QUOTA, "count: %d, lqs pending: %lu, qd_count: "LPU64
+ ", metablocks: %d, isblk: %d, pending: %d.\n", count,
+ isblk ? lqs->lqs_bwrite_pending : lqs->lqs_iwrite_pending,
+ qdata[i].qd_count, mb, isblk, *pending);
if (rc2[i] == QUOTA_RET_OK) {
if (isblk && qdata[i].qd_count < lqs->lqs_bwrite_pending)
rc2[i] = QUOTA_RET_ACQUOTA;
lqs->lqs_iwrite_pending)
rc2[i] = QUOTA_RET_ACQUOTA;
}
+
spin_unlock(&lqs->lqs_lock);
- CDEBUG(D_QUOTA, "count: %d, lqs pending: %lu, qd_count: "LPU64
- ", metablocks: %d, isblk: %d, pending: %d.\n", count,
- isblk ? lqs->lqs_bwrite_pending : lqs->lqs_iwrite_pending,
- qdata[i].qd_count, mb, isblk, *pending);
+
+ if (lqs->lqs_blk_rec < 0 &&
+ qdata[i].qd_count <
+ lqs->lqs_bwrite_pending - lqs->lqs_blk_rec - mb)
+ OBD_FAIL_TIMEOUT(OBD_FAIL_QUOTA_DELAY_REL, 5);
/* When cycle is zero, lqs_*_pending will be changed. We will
* get reference of the lqs here and put reference of lqs in
l_wait_event(qctxt->lqc_wait_for_qmaster, check_qm(qctxt),
&lwi);
CDEBUG(D_QUOTA, "wake up when quota master is back\n");
- lc_watchdog_touch(oti->oti_thread->t_watchdog);
+ lc_watchdog_touch(oti->oti_thread->t_watchdog,
+ GET_TIMEOUT(oti->oti_thread->t_svc));
} else {
spin_unlock(&qctxt->lqc_lock);
}
/* please reference to dqacq_completion for the below */
/* a new request is finished, try again */
- if (rc == -EAGAIN) {
+ if (rc == QUOTA_REQ_RETURNED) {
CDEBUG(D_QUOTA, "finish a quota req, try again\n");
continue;
}
struct l_wait_info lwi;
if (oti && oti->oti_thread && oti->oti_thread->t_watchdog)
- lc_watchdog_touch(oti->oti_thread->t_watchdog);
+ lc_watchdog_touch(oti->oti_thread->t_watchdog,
+ GET_TIMEOUT(oti->oti_thread->t_svc));
CDEBUG(D_QUOTA, "rc: %d, count_err: %d\n", rc,
count_err++);