On Tue, Jun 28, 2022 at 10:56:12AM -0700, Bart Van Assche wrote: > There are two .exit_cmd_priv implementations. Both implementations use the > SCSI host pointer. Make sure that the SCSI host pointer is valid when > .exit_cmd_priv is called by moving the .exit_cmd_priv calls from > scsi_device_dev_release() to scsi_forget_host(). Moving > blk_mq_free_tag_set() from scsi_device_dev_release() to scsi_forget_host() > is safe because scsi_forget_host() drains all the request queues that use > the host tag set. This guarantees that no requests are in flight and also > that no new requests will be allocated from the host tag set. Not sure scsi_forget_host really drains all queues since it bypasses sdev which state is SDEV_DEL, so removal for this sdev could be in-progress, not done yet. Thanks, Ming