From 3e31fd16d31d7dc13f7f72ba1b689ffda743ac1f Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Fri, 26 Jan 2024 18:57:34 +0800 Subject: [PATCH] LU-16736 quota: set revoke time to avoid endless wait The revoke time of the lquota entry should be set when its qunit reaches least qunit, but it could not be set in some rare case, which could be related to the broken quota LDLM lock, set it in "qmt_acquire" to avoid endless wait in QSD. Lustre-change: https://review.whamcloud.com/50626 Lustre-commit: 49730821c4e5116f188c931830ce23b2da2d8a41 Signed-off-by: Hongchao Zhang Change-Id: Ib68c5dc881346e0e619d43553ee490847ae5e225 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54907 Reviewed-by: Andreas Dilger Reviewed-by: Sergey Cheremencev Tested-by: jenkins Tested-by: Maloo --- lustre/quota/qmt_entry.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lustre/quota/qmt_entry.c b/lustre/quota/qmt_entry.c index 9fdd79a..a3ff599 100644 --- a/lustre/quota/qmt_entry.c +++ b/lustre/quota/qmt_entry.c @@ -536,8 +536,17 @@ bool qmt_adjust_edquot(struct lquota_entry *lqe, __u64 now) RETURN(false); /* least qunit value not sent to all slaves yet */ - if (lqe->lqe_revoke_time == 0) + if (lqe->lqe_revoke_time == 0 && + !lqe->lqe_gl && list_empty(&lqe->lqe_link)) { + /* LU-16736: the revoke_time should be set when + * the qunit reachs the least qunit, the quota + * LDLM lock could encounter some issue, setting + * it to avoid endless wait in QSD. */ + LQUOTA_ERROR(lqe, "set revoke_time explicitly"); + + lqe->lqe_revoke_time = ktime_get_seconds(); RETURN(false); + } /* Let's give more time to slave to release space */ lapse = ktime_get_seconds() - QMT_REBA_TIMEOUT; -- 1.8.3.1