From 1f0ce86f3c3f37a6f08f1a0e2a62e589ae5d3e7e Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Wed, 19 Jul 2023 18:00:09 +0300 Subject: [PATCH] scst: Fix removal of deprecated create_workqueue() create_workqueue() was replaced with alloc_workqueue() with max_active set to 0. However, the original create_workqueue() implicitly set max_active to 1. This change has led to unexpected bugs because previously, work items could only be executed one by one. With the change, they can now be executed simultaneously. This patch fixes the issue by restoring max_active to 1. Fixes: f4686e9102c1 ("scst: Remove deprecated create_workqueue()") Fixes: https://github.com/SCST-project/scst/issues/179 --- iscsi-scst/kernel/isert-scst/iser_global.c | 2 +- qla2x00t/qla_os.c | 2 +- scst/src/scst_lib.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iscsi-scst/kernel/isert-scst/iser_global.c b/iscsi-scst/kernel/isert-scst/iser_global.c index 5b8b92b97..e6e0ec2d4 100644 --- a/iscsi-scst/kernel/isert-scst/iser_global.c +++ b/iscsi-scst/kernel/isert-scst/iser_global.c @@ -138,7 +138,7 @@ int isert_global_init(void) spin_lock_init(&isert_glob.portal_lock); init_waitqueue_head(&isert_glob.portal_wq); - isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", WQ_MEM_RECLAIM, 0); + isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", WQ_MEM_RECLAIM, 1); if (!isert_glob.conn_wq) { PRINT_ERROR("Failed to alloc iser conn work queue"); return -ENOMEM; diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index 0c3c70a0a..5d34b93d0 100644 --- a/qla2x00t/qla_os.c +++ b/qla2x00t/qla_os.c @@ -450,7 +450,7 @@ static int qla25xx_setup_mode(struct scsi_qla_host *vha) "Failed to create request queue.\n"); goto fail; } - ha->wq = alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM, 0); + ha->wq = alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM, 1); vha->req = ha->req_q_map[req]; options |= BIT_1; for (ques = 1; ques < ha->max_rsp_queues; ques++) { diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 283a28bbd..e12623074 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -15499,7 +15499,7 @@ int __init scst_lib_init(void) scst_scsi_op_list_init(); - scst_release_acg_wq = alloc_workqueue("scst_release_acg", WQ_MEM_RECLAIM, 0); + scst_release_acg_wq = alloc_workqueue("scst_release_acg", WQ_MEM_RECLAIM, 1); if (unlikely(!scst_release_acg_wq)) { PRINT_ERROR("Failed to allocate scst_release_acg_wq"); res = -ENOMEM;