Whamcloud - gitweb
LU-13677 quota: qunit sorting doesn't work 42/38942/2
authorSergey Cheremencev <sergey.cheremencev@hpe.com>
Mon, 15 Jun 2020 15:11:09 +0000 (18:11 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 10 Jul 2020 16:51:37 +0000 (16:51 +0000)
As sorting doesn't work correctly, sometimes
new decreased qunit may be not sent to OST.
If qunit reaches it's minimum and is not sent
to OST, this may cause a client to hung on
write as OST gets EINPROGRESS instead of
EDQUOT. Patch solves this issue.

Change-Id: I3ae22cc4d080968132ca762b9c0915a994ac126e
Signed-off-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-on: https://review.whamcloud.com/38942
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/quota/qmt_pool.c

index 1a4ff12..9f7563c 100644 (file)
@@ -845,9 +845,9 @@ out:
 static int lqes_cmp(const void *arg1, const void *arg2)
 {
        const struct lquota_entry *lqe1, *lqe2;
-       lqe1 = arg1;
-       lqe2 = arg2;
-       return lqe1->lqe_qunit > lqe2->lqe_qunit;
+       lqe1 = *(const struct lquota_entry **)arg1;
+       lqe2 = *(const struct lquota_entry **)arg2;
+       return lqe1->lqe_qunit - lqe2->lqe_qunit;
 }
 
 void qmt_lqes_sort(const struct lu_env *env)