diff --git a/iscsi-scst/kernel/isert-scst/iser_global.c b/iscsi-scst/kernel/isert-scst/iser_global.c index 4718025ee..5b8b92b97 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 = create_workqueue("isert_conn_wq"); + isert_glob.conn_wq = alloc_workqueue("isert_conn_wq", WQ_MEM_RECLAIM, 0); if (!isert_glob.conn_wq) { PRINT_ERROR("Failed to alloc iser conn work queue"); return -ENOMEM; @@ -148,21 +148,26 @@ int isert_global_init(void) SCST_SLAB_FLAGS|SLAB_HWCACHE_ALIGN, iscsi); if (!isert_cmnd_cache) { - destroy_workqueue(isert_glob.conn_wq); PRINT_ERROR("Failed to alloc iser command cache"); - return -ENOMEM; + goto free_wq; } isert_conn_cache = KMEM_CACHE(isert_conn, SCST_SLAB_FLAGS|SLAB_HWCACHE_ALIGN); if (!isert_conn_cache) { - destroy_workqueue(isert_glob.conn_wq); - kmem_cache_destroy(isert_cmnd_cache); PRINT_ERROR("Failed to alloc iser connection cache"); - return -ENOMEM; + goto free_cmnd_cache; } return 0; + +free_cmnd_cache: + kmem_cache_destroy(isert_cmnd_cache); + +free_wq: + destroy_workqueue(isert_glob.conn_wq); + + return -ENOMEM; } void isert_global_cleanup(void) diff --git a/qla2x00t/qla_os.c b/qla2x00t/qla_os.c index 3b84c23a4..1b49c4da2 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 = create_workqueue("qla2xxx_wq"); + ha->wq = alloc_workqueue("qla2xxx_wq", WQ_MEM_RECLAIM, 0); 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 2d5e792f5..0d5c4e322 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -15311,7 +15311,7 @@ int __init scst_lib_init(void) scst_scsi_op_list_init(); - scst_release_acg_wq = create_workqueue("scst_release_acg"); + scst_release_acg_wq = alloc_workqueue("scst_release_acg", WQ_MEM_RECLAIM, 0); if (unlikely(!scst_release_acg_wq)) { PRINT_ERROR("Failed to allocate scst_release_acg_wq"); res = -ENOMEM;