• Mike Christie's avatar
    vhost-scsi: Handle vhost_vq_work_queue failures for events · b1b2ce58
    Mike Christie authored
    Currently, we can try to queue an event's work before the vhost_task is
    created. When this happens we just drop it in vhost_scsi_do_plug before
    even calling vhost_vq_work_queue. During a device shutdown we do the
    same thing after vhost_scsi_clear_endpoint has cleared the backends.
    
    In the next patches we will be able to kill the vhost_task before we
    have cleared the endpoint. In that case, vhost_vq_work_queue can fail
    and we will leak the event's memory. This has handle the failure by
    just freeing the event. This is safe to do, because
    vhost_vq_work_queue will only return failure for us when the vhost_task
    is killed and so userspace will not be able to handle events if we
    sent them.
    Signed-off-by: default avatarMike Christie <michael.christie@oracle.com>
    Message-Id: <20240316004707.45557-2-michael.christie@oracle.com>
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    b1b2ce58
scsi.c 67.7 KB