On 4/24/21 3:34 PM, Mike Christie wrote: > Or could you have something like: > > efct_dispatch_frame -> efct_dispatch_fcp_cmd -> efct_scsi_recv_cmd > > running when this happening? Was there some place like here where > efct_node->session was set to NULL and that's what we try to detect > in efct_scsi_recv_cmd? Oh yeah, I think if you can still have IO running from inside the driver you want to move the target_remove_session call to _efct_tgt_node_free. We will then handle the case where a cmd has passed efct_node_find and got a ref to the efct_node but not yet reached target_init_cmd. When the cmd hits target_init_cmd lio will return a failure, efct_dispatch_frame will drop its ref, and then we will free the efct_node and lio session.