Whamcloud - gitweb
LU-15025 quota: stale edquot after clearing limits
authorSergey Cheremencev <sergey.cheremencev@hpe.com>
Fri, 18 Jun 2021 16:08:16 +0000 (19:08 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 10 May 2022 06:27:53 +0000 (06:27 +0000)
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".

Lustre-change: https://review.whamcloud.com/45000
Lustre-commit: 6ed5d6ed3bd0a705c6ae8c37a0b7e8906ebc6079

HPE-bug-id: LUS-10146
Change-Id: I1e08929bae7e1b37b1e8cbbc44859a786b5fb090
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Tested-by: Elena Gryaznova <c17455@cray.com>
Signed-off-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-on: https://review.whamcloud.com/46657
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/quota/qmt_handler.c

index 31d3af2..3663022 100644 (file)
@@ -223,10 +223,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;
        }