• Chris Leech's avatar
    [SCSI] iscsi_tcp: consider session state in iscsi_sw_sk_state_check · c712495e
    Chris Leech authored
    It seems some iSCSI targets (including the Linux kernel target) close
    the TCP connection from the target side immediately after processing a
    session logout.
    
    When a TCP FIN comes in right after the iSCSI logout response,
    iscsi_sw_sk_state_check sees the local socket as not yet being in
    CLOSE_WAIT or CLOSE and logs an error.  But the initiator would close
    the connection right after processing the logout response anyway, and
    the error is confusing to admins who just requested that the session be
    shut down.
    
    This adds a check of the session state, and suppresses the error if we
    are in the process of logging out.
    Signed-off-by: default avatarChris Leech <cleech@redhat.com>
    Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
    Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
    c712495e
iscsi_tcp.c 27.5 KB