]> git.karo-electronics.de Git - karo-tx-linux.git/commit
iscsi-target: Add sk->sk_state_change to cleanup after TCP failure
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 5 Sep 2013 21:54:04 +0000 (14:54 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 9 Sep 2013 21:26:41 +0000 (14:26 -0700)
commitbb048357dad6d604520c91586334c9c230366a14
tree091e848fd2604b1cfaf1bfba80f07c3535f7ae4c
parentd381a8010a052813a88e20e089be4a58aad8b40a
iscsi-target: Add sk->sk_state_change to cleanup after TCP failure

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: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_core.h
drivers/target/iscsi/iscsi_target_nego.c