diff options
author | Mike Christie <michael.christie@oracle.com> | 2022-02-26 17:04:34 -0600 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2022-03-01 23:56:28 -0500 |
commit | 7cb6683ce761eda9b474e4d612cdfc2067a5ea07 (patch) | |
tree | 77e53cd47a078f01bf84ac7c0a455cb63397d1ac /drivers/scsi/scsi_transport_iscsi.c | |
parent | 5842ea3668310466dcf645a23b6cd5012ce2eadf (diff) | |
download | linux-7cb6683ce761eda9b474e4d612cdfc2067a5ea07.tar.bz2 |
scsi: iscsi: Use the session workqueue for recovery
Use the session workqueue for recovery and unbinding. If there are delays
during device blocking/cleanup then it will no longer affect other
sessions.
Link: https://lore.kernel.org/r/20220226230435.38733-6-michael.christie@oracle.com
Reviewed-by: Chris Leech <cleech@redhat.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
-rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index ecb592a70e03..754277bec63a 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -87,7 +87,6 @@ struct iscsi_internal { }; static atomic_t iscsi_session_nr; /* sysfs session id for next new session */ -static struct workqueue_struct *iscsi_eh_timer_workq; static struct workqueue_struct *iscsi_conn_cleanup_workq; @@ -1913,7 +1912,7 @@ void iscsi_unblock_session(struct iscsi_cls_session *session) if (!cancel_work_sync(&session->block_work)) cancel_delayed_work_sync(&session->recovery_work); - queue_work(iscsi_eh_timer_workq, &session->unblock_work); + queue_work(session->workq, &session->unblock_work); /* * Blocking the session can be done from any context so we only * queue the block work. Make sure the unblock work has completed @@ -1937,14 +1936,14 @@ static void __iscsi_block_session(struct work_struct *work) scsi_target_block(&session->dev); ISCSI_DBG_TRANS_SESSION(session, "Completed SCSI target blocking\n"); if (session->recovery_tmo >= 0) - queue_delayed_work(iscsi_eh_timer_workq, + queue_delayed_work(session->workq, &session->recovery_work, session->recovery_tmo * HZ); } void iscsi_block_session(struct iscsi_cls_session *session) { - queue_work(iscsi_eh_timer_workq, &session->block_work); + queue_work(session->workq, &session->block_work); } EXPORT_SYMBOL_GPL(iscsi_block_session); @@ -4851,26 +4850,16 @@ static __init int iscsi_transport_init(void) goto unregister_flashnode_bus; } - iscsi_eh_timer_workq = alloc_workqueue("%s", - WQ_SYSFS | __WQ_LEGACY | WQ_MEM_RECLAIM | WQ_UNBOUND, - 1, "iscsi_eh"); - if (!iscsi_eh_timer_workq) { - err = -ENOMEM; - goto release_nls; - } - iscsi_conn_cleanup_workq = alloc_workqueue("%s", WQ_SYSFS | WQ_MEM_RECLAIM | WQ_UNBOUND, 0, "iscsi_conn_cleanup"); if (!iscsi_conn_cleanup_workq) { err = -ENOMEM; - goto destroy_wq; + goto release_nls; } return 0; -destroy_wq: - destroy_workqueue(iscsi_eh_timer_workq); release_nls: netlink_kernel_release(nls); unregister_flashnode_bus: @@ -4893,7 +4882,6 @@ unregister_transport_class: static void __exit iscsi_transport_exit(void) { destroy_workqueue(iscsi_conn_cleanup_workq); - destroy_workqueue(iscsi_eh_timer_workq); netlink_kernel_release(nls); bus_unregister(&iscsi_flashnode_bus); transport_class_unregister(&iscsi_connection_class); |