Skip to content

qla2xxx: fix session free stall by using scst_unregister_session wait=0#347

Merged
lnocturno merged 1 commit intoSCST-project:masterfrom
bmeagherix:fix_fc_session_teardown_stall
Mar 2, 2026
Merged

qla2xxx: fix session free stall by using scst_unregister_session wait=0#347
lnocturno merged 1 commit intoSCST-project:masterfrom
bmeagherix:fix_fc_session_teardown_stall

Conversation

@bmeagherix
Copy link
Contributor

Calling scst_unregister_session(wait=1) from qlt_free_session_done blocks the qla2xxx_wq worker until session teardown completes, but teardown requires the TM thread to process SCST_UNREG_SESS_TM while the TM thread is blocked on scst_mutex held by concurrent session teardown (scst_sess_free_tgt_devs -> synchronize_rcu()) in the global management thread.

Under load this stall exceeds the hung-task timeout. Switch to wait=0 and wait on fcport->unreg_done instead, matching the pattern in iscsi-scst.

sqa_free_session_done() is called from scst_free_session() between its two scst_mutex windows, so the completion is signalled without holding the lock.

(IMO, the declaration of the completion and setting of fcport->unreg_done hints that this was always the intent.)

Calling scst_unregister_session(wait=1) from qlt_free_session_done
blocks the qla2xxx_wq worker until session teardown completes, but
teardown requires the TM thread to process SCST_UNREG_SESS_TM while
the TM thread is blocked on scst_mutex held by concurrent session
teardown in the global management thread. Under load this stall
exceeds the hung-task timeout. Switch to wait=0 and wait on
fcport->unreg_done instead, matching the pattern in iscsi-scst.
@lnocturno lnocturno merged commit 84a23a2 into SCST-project:master Mar 2, 2026
51 checks passed
@lnocturno
Copy link
Contributor

Hi Brian,

Thank you for the patch!

Gleb

@bmeagherix bmeagherix deleted the fix_fc_session_teardown_stall branch March 2, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants