Re: [PATCH] scsi: elx: efct: hold a node reference across asynchronous session setup

From: Yehyeong Lee

Date: Wed Oct 21 2026 - 09:19:55 EST


Thanks for the review. The concern is right, so I have sent a v2 rather
than argue it.

v1 gated the setup work on node->nport and node->req_free, but that is
not enough. req_free is only set in __efc_node_shutdown(), which the node
reaches after efct_scsi_del_initiator() has already run and returned, so
a node sitting in __efc_d_wait_del_node still passes the test. On that
path the setup work can register a session that nothing ever removes, and
in the narrow window where efct_session_cb() has published node->tgt_node
it can store a lookup entry after efct_scsi_del_initiator() erased it,
leaving a freed pointer in efct->lookup.

v2 drops that predicate and gives the node an explicit target-session
state, read and written under efc->lock, so efct_scsi_del_initiator() and
the setup work agree on who owns the session. I have posted it as a v2 at
https://lore.kernel.org/r/20261021130802.2691833-1-yhlee@xxxxxxxxxxxxxxxxxx