• Mike Christie's avatar
    vhost-scsi: Drop device mutex use in vhost_scsi_do_plug · eb1b2914
    Mike Christie authored
    We don't need the device mutex in vhost_scsi_do_plug because:
    1. we have the vhost_scsi_mutex so the tpg->vhost_scsi pointer will not
    change on us and the vhost_scsi can't be freed from under us if it was
    set.
    2. vhost_scsi_clear_endpoint will stop the virtqueues and flush them while
    holding the vhost_scsi_mutex so we know once vhost_scsi_clear_endpoint
    has completed that vhost_scsi_do_plug can't send new events and any
    queued ones have completed.
    
    So this patch drops the device mutex use in vhost_scsi_do_plug.
    Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
    Message-Id: <20230321020624.13323-5-michael.christie@oracle.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    eb1b2914
scsi.c 64.6 KB