• Nicholas Bellinger's avatar
    iscsi-target: Add sk->sk_state_change to cleanup after TCP failure · bb048357
    Nicholas Bellinger authored
    
    
    This patch adds a sock->sk_state_change() -> iscsi_target_sk_state_change()
    callback in order to handle transient TCP failures during the login process,
    where sock->sk_data_ready() -> iscsi_target_sk_data_ready() may not be
    called to release connection resources, and relinquish tpg->np_login_lock
    via iscsit_deaccess_np()
    
    It performs the sk->sk_state check using iscsi_target_sk_state_check() to
    look for TCP_CLOSE_WAIT + TCP_CLOSE, and invokes schedule_delayed_work() ->
    iscsi_target_do_cleanup() to perform the remaining cleanup from process
    context.
    
    It adds an explicit sk_state_check to iscsi_target_do_login() in order
    to determine a state failure when iscsi_target_sk_state_change() may
    not be able to proceed before LOGIN_FLAGS_READY=1 is set.
    
    Also use sk->sk_sndtimeo -> sk->sk_rcvtimeo settings during login to
    iscsi_target_set_sock_callbacks(), and revert back post login to use
    MAX_SCHEDULE_TIMEOUT in iscsi_target_restore_sock_callbacks().
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    bb048357