From: Hongchao Zhang Date: Sun, 3 Mar 2024 02:11:36 +0000 (+0800) Subject: LU-18024 quota: fix the order of freeing qmt_lvbo_free_wq X-Git-Tag: 2.16.0-RC5~9 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F78%2F56778%2F2;p=fs%2Flustre-release.git LU-18024 quota: fix the order of freeing qmt_lvbo_free_wq In qmt_device_fini, put the freeing of the qmt_lvbo_free_wq after all possible usage of it having finished cleanup. Signed-off-by: Hongchao Zhang Change-Id: Ia26f1bc490adff5ae7dc850e2c89baf5874f01c5 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56778 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Sergey Cheremencev Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/quota/qmt_dev.c b/lustre/quota/qmt_dev.c index 77ba633..dc3ae6e 100644 --- a/lustre/quota/qmt_dev.c +++ b/lustre/quota/qmt_dev.c @@ -77,11 +77,6 @@ static struct lu_device *qmt_device_fini(const struct lu_env *env, CDEBUG(D_QUOTA, "%s: initiating QMT shutdown\n", qmt->qmt_svname); qmt->qmt_stopping = true; - if (qmt->qmt_lvbo_free_wq) { - destroy_workqueue(qmt->qmt_lvbo_free_wq); - qmt->qmt_lvbo_free_wq = NULL; - } - /* kill pool instances, if any */ qmt_pool_fini(env, qmt); @@ -111,6 +106,11 @@ static struct lu_device *qmt_device_fini(const struct lu_env *env, ld->ld_obd->obd_namespace = NULL; qmt->qmt_ns = NULL; + if (qmt->qmt_lvbo_free_wq) { + destroy_workqueue(qmt->qmt_lvbo_free_wq); + qmt->qmt_lvbo_free_wq = NULL; + } + RETURN(NULL); } diff --git a/lustre/quota/qmt_internal.h b/lustre/quota/qmt_internal.h index a793a2c..022ab40 100644 --- a/lustre/quota/qmt_internal.h +++ b/lustre/quota/qmt_internal.h @@ -10,8 +10,6 @@ #include "lquota_internal.h" -extern struct workqueue_struct *qmt_lvbo_free_wq; - /* * The Quota Master Target Device. * The qmt is responsible for: