Whamcloud - gitweb
LU-17034 revert: "quota: tmp fix against memory corruption"
authorSergey Cheremencev <scherementsev@ddn.com>
Thu, 18 Jan 2024 19:03:50 +0000 (22:03 +0300)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 24 Feb 2024 03:48:56 +0000 (03:48 +0000)
This reverts commit fdcb1144c95908bbbd0216ec931ac5f222f484a7
as it was a temporary solution. Instead of that will be landed
"LU-17034 quota: lqeg_arr memmory corruption".

Signed-off-by: Sergey Cheremencev <scherementsev@ddn.com>
Change-Id: I6c057ff7e0f9c8789190c51c14fc370afe0c703c
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53809
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/quota/qmt_entry.c
lustre/tests/conf-sanity.sh

index 9fdd79a..2ebf260 100644 (file)
@@ -1088,7 +1088,7 @@ void qti_lqes_write_unlock(const struct lu_env *env)
                lqe_write_unlock(qti_lqes(env)[i]);
 }
 
-#define QMT_INIT_SLV_CNT       2048
+#define QMT_INIT_SLV_CNT       64
 struct lqe_glbl_data *qmt_alloc_lqe_gd(struct qmt_pool_info *pool, int qtype)
 {
        struct lqe_glbl_data    *lgd;
@@ -1102,7 +1102,7 @@ struct lqe_glbl_data *qmt_alloc_lqe_gd(struct qmt_pool_info *pool, int qtype)
        slv_cnt = qpi_slv_nr_by_rtype(pool, qtype);
 
        glbe_num = slv_cnt < QMT_INIT_SLV_CNT ? QMT_INIT_SLV_CNT : slv_cnt;
-       OBD_ALLOC_LARGE(lqeg_arr, sizeof(struct lqe_glbl_entry) * glbe_num);
+       OBD_ALLOC(lqeg_arr, sizeof(struct lqe_glbl_entry) * glbe_num);
        if (!lqeg_arr) {
                OBD_FREE(lgd, sizeof(struct lqe_glbl_data));
                RETURN(NULL);
@@ -1122,7 +1122,7 @@ void qmt_free_lqe_gd(struct lqe_glbl_data *lgd)
        if (unlikely(!lgd))
                return;
 
-       OBD_FREE_LARGE(lgd->lqeg_arr,
+       OBD_FREE(lgd->lqeg_arr,
                 sizeof(struct lqe_glbl_entry) * lgd->lqeg_num_alloc);
        OBD_FREE(lgd, sizeof(struct lqe_glbl_data));
 }
@@ -1153,7 +1153,7 @@ void qmt_seed_glbe_all(const struct lu_env *env, struct lqe_glbl_data *lgd,
        if (qunit)
                qmt_lqes_sort(env);
 
-       for (i = 0; i < lgd->lqeg_num_alloc; i++) {
+       for (i = 0; i < lgd->lqeg_num_used; i++) {
                lgd->lqeg_arr[i].lge_qunit_set = 0;
                lgd->lqeg_arr[i].lge_qunit_nu = 0;
                lgd->lqeg_arr[i].lge_edquot_nu = 0;
@@ -1166,7 +1166,8 @@ void qmt_seed_glbe_all(const struct lu_env *env, struct lqe_glbl_data *lgd,
                CDEBUG(D_QUOTA, "lqes_cnt %d, i %d\n", qti_lqes_cnt(env), i);
                qpi = lqe2qpi(lqe);
                if (qmt_pool_global(qpi)) {
-                       slaves_cnt = lgd->lqeg_num_alloc;
+                       slaves_cnt = qpi_slv_nr_by_rtype(lqe2qpi(lqe),
+                                                        lqe_qtype(lqe));
                } else {
                        if (!pool_locked) {
                                sem = qmt_sarr_rwsem(qpi);
index 586dd2d..3cb295e 100644 (file)
@@ -15,7 +15,7 @@ init_logging
 ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT 32newtarball"
 
 # bug number for skipped test: LU-11915 EX-3746
-ALWAYS_EXCEPT="$ALWAYS_EXCEPT  110 115  5a"
+ALWAYS_EXCEPT="$ALWAYS_EXCEPT 33c 110 115  5a"
 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
 
 if $SHARED_KEY; then