• Mike Christie's avatar
    [SCSI] libiscsi: don't increment cmdsn if cmd is not sent · d3305f34
    Mike Christie authored
    We increment session->cmdsn at the top of iscsi_prep_scsi_cmd_pdu, but
    if the prep  ecb or prep bidi or init_task calls fails then we leave the
    session->cmdsn incremented. This moves the cmdsn manipulation to the end
    of the function when we know it has succeeded.
    
    It also adds a session->cmdsn--; in queuecommand for if a driver like
    bnx2i tries to send a a task from that context but it fails. We do not
    have to do this in the xmit thread context because that code will retry
    the same task if the initial call fails.
    Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
    Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
    d3305f34
libiscsi.c 79.4 KB