On 2/22/23 6:19 PM, Mike Christie wrote: > We don't need the vhost_scsi_mutex in vhost_scsi_port_link and > vhost_scsi_port_unlink because LIO has a refcount on the se_tpg for us, > so it can't be removed while these functions are called. This removes the > vhost_scsi_mutex from those functions to avoid cases where we are adding > or removing LUNs to vhost-deviceA but are stuck waiting on the > vhost_scsi_mutex because we are running vhost_scsi_clear_endpoint on > vhost-deviceB and it's stuck in vhost_scsi_flush waiting for a flakey > physical device. I'm going to self Nack these patches. This patch has a bug where we can leak vhost_scsi_tmf structs. It's ok to drop the vhost_scsi_mutex use but in vhost_scsi_port_unlink it needs to be replaced with the device->mutex or we need to flush the tmf/VHOST_SCSI_VQ_CTL queue to make sure outstanding tmfs are freed.