Whamcloud - gitweb
LU-15049 quota: fix a panic with pool number > 16 05/45105/3
authorSergey Cheremencev <sergey.cheremencev@hpe.com>
Thu, 17 Jun 2021 10:45:42 +0000 (13:45 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 20 Nov 2021 06:25:53 +0000 (06:25 +0000)
Fix a panic that may occur when there are more than 16
pools in a system:
qti_pools_add()) ASSERTION( qti->qti_pools_num >= QMT_MAX_POOL_NUM ) failed: Forgot init? ffff91a5f9625800

HPE-bug-id: LUS-10116
Change-Id: I4f73b74d2fd3e85a51cf3c30e2eec29645f164be
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Reviewed-by: Shaun Tancheff <stancheff@cray.com>
Tested-by: Elena Gryaznova <c17455@cray.com>
Signed-off-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-on: https://review.whamcloud.com/45105
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/quota/qmt_entry.c
lustre/quota/qmt_pool.c

index 03dc1d7..da525a5 100644 (file)
@@ -872,7 +872,7 @@ int qti_lqes_add(const struct lu_env *env, struct lquota_entry *lqe)
 {
        struct qmt_thread_info  *qti = qmt_info(env);
 
-       if (qti->qti_lqes_cnt > qti->qti_lqes_num) {
+       if (qti->qti_lqes_cnt >= qti->qti_lqes_num) {
                struct lquota_entry     **lqes;
                lqes = qti->qti_lqes;
                OBD_ALLOC(lqes, sizeof(lqe) * qti->qti_lqes_num * 2);
index 8d4fee7..755effd 100644 (file)
@@ -312,7 +312,7 @@ static inline int qti_pools_add(const struct lu_env *env,
        LASSERTF(qti->qti_pools_num >= QMT_MAX_POOL_NUM,
                 "Forgot init? %p\n", qti);
 
-       if (qti->qti_pools_cnt > qti->qti_pools_num) {
+       if (qti->qti_pools_cnt >= qti->qti_pools_num) {
                OBD_ALLOC(pools, sizeof(qpi) * qti->qti_pools_num * 2);
                if (!pools)
                        return -ENOMEM;