From 6ed5d6ed3bd0a705c6ae8c37a0b7e8906ebc6079 Mon Sep 17 00:00:00 2001 From: Sergey Cheremencev Date: Fri, 18 Jun 2021 19:08:16 +0300 Subject: [PATCH] LU-15025 quota: stale edquot after clearing limits When hard and soft limit set to 0, lqe enforced flag is also set to false. As qmt_adjust_qunit does not handle not enforced lqes, edquot set to the pool continues to be true and a user gets -EDQUOT even if all pool limits are cleared. This was ok for global pool lqe as since it turned off, zero limits are sent to OSTs causing OSTs to release all granted space and avoid EDQUOT. Fix this for PQ - set edquot and qunit to zero, since appropriate lqe becomes "not enforced". HPE-bug-id: LUS-10146 Change-Id: I1e08929bae7e1b37b1e8cbbc44859a786b5fb090 Reviewed-on: https://es-gerrit.dev.cray.com/158915/ Reviewed-by: Alexander Boyko Tested-by: Elena Gryaznova Tested-by: Jenkins Build User Signed-off-by: Sergey Cheremencev Reviewed-on: https://review.whamcloud.com/45000 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- lustre/quota/qmt_handler.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lustre/quota/qmt_handler.c b/lustre/quota/qmt_handler.c index 28b860e..2ed9051 100644 --- a/lustre/quota/qmt_handler.c +++ b/lustre/quota/qmt_handler.c @@ -220,10 +220,18 @@ quota_set: /* change enforced status based on new parameters */ if (lqe->lqe_id.qid_uid == 0 || (lqe->lqe_hardlimit == 0 && - lqe->lqe_softlimit == 0)) - lqe->lqe_enforced = false; - else + lqe->lqe_softlimit == 0)) { + if (lqe->lqe_enforced) { + lqe->lqe_enforced = false; + /* Clear qunit and edquot as lqe_adjust_edquot + * does not handle not enforced lqes */ + lqe->lqe_edquot = 0; + lqe->lqe_qunit = 0; + need_id_notify = true; + } + } else { lqe->lqe_enforced = true; + } dirtied = true; } -- 1.8.3.1