The global variable "qmt_lvbo_free_wq" could be affected if there
are more than one Lustre mount (for instance, using snapshot),
this patch moves it into "struct qmt_device" and it will only be
used by this QMT(MDT0000) and avoid conflict.
Fixes:
2cc18ece1e ("LU-14535 quota: free lvbo in a wq")
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Change-Id: I298382fa0eed6885e55991e26e4b36d435e99e26
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56661
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Sergey Cheremencev <scherementsev@ddn.com>
CDEBUG(D_QUOTA, "%s: initiating QMT shutdown\n", qmt->qmt_svname);
qmt->qmt_stopping = true;
- if (qmt_lvbo_free_wq) {
- destroy_workqueue(qmt_lvbo_free_wq);
- qmt_lvbo_free_wq = NULL;
+ if (qmt->qmt_lvbo_free_wq) {
+ destroy_workqueue(qmt->qmt_lvbo_free_wq);
+ qmt->qmt_lvbo_free_wq = NULL;
}
/* kill pool instances, if any */
if (rc)
GOTO(out, rc);
- qmt_lvbo_free_wq = alloc_workqueue("qmt_lvbo_free", WQ_UNBOUND, 0);
- if (!qmt_lvbo_free_wq) {
+ qmt->qmt_lvbo_free_wq = alloc_workqueue("qmt_lvbo_free", WQ_UNBOUND, 0);
+ if (!qmt->qmt_lvbo_free_wq) {
rc = -ENOMEM;
CERROR("%s: failed to start qmt_lvbo_free workqueue: rc = %d\n",
qmt->qmt_svname, rc);
/* lock protecting rebalancing list */
spinlock_t qmt_reba_lock;
+ struct workqueue_struct *qmt_lvbo_free_wq;
+
unsigned long qmt_stopping:1; /* qmt is stopping */
};
#include "qmt_internal.h"
-struct workqueue_struct *qmt_lvbo_free_wq;
-
/* intent policy function called from mdt_intent_opc() when the intent is of
* quota type */
int qmt_intent_policy(const struct lu_env *env, struct lu_device *ld,
*/
int qmt_lvbo_free(struct lu_device *ld, struct ldlm_resource *res)
{
+ struct qmt_device *qmt = lu2qmt_dev(ld);
+
ENTRY;
if (res->lr_lvb_data == NULL)
if (res->lr_name.name[LUSTRE_RES_ID_QUOTA_SEQ_OFF] != 0) {
struct lquota_entry *lqe = res->lr_lvb_data;
- queue_work(qmt_lvbo_free_wq, &lqe->lqe_work);
+ queue_work(qmt->qmt_lvbo_free_wq, &lqe->lqe_work);
} else {
struct dt_object *obj = res->lr_lvb_data;
/* release object reference */