From a0e766235d6d4c045184f0d8a1906a49ad262230 Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Sun, 3 Mar 2024 10:11:36 +0800 Subject: [PATCH] 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 --- lustre/quota/qmt_dev.c | 10 +++++----- lustre/quota/qmt_internal.h | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) 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: -- 1.8.3.1