From 8704d14c466706e3ebe9528f08919e923a5b98c8 Mon Sep 17 00:00:00 2001 From: Sergey Cheremencev Date: Mon, 15 Jun 2020 18:11:09 +0300 Subject: [PATCH] LU-13677 quota: qunit sorting doesn't work 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 Reviewed-on: https://review.whamcloud.com/38942 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Alexander Boyko Reviewed-by: Oleg Drokin --- lustre/quota/qmt_pool.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lustre/quota/qmt_pool.c b/lustre/quota/qmt_pool.c index 1a4ff12..9f7563c 100644 --- a/lustre/quota/qmt_pool.c +++ b/lustre/quota/qmt_pool.c @@ -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) -- 1.8.3.1