summaryrefslogtreecommitdiffstats
path: root/drivers/target/iscsi/iscsi_target_core.h
diff options
context:
space:
mode:
authorNicholas Bellinger2013-09-05 23:54:04 +0200
committerNicholas Bellinger2013-09-09 23:26:41 +0200
commitbb048357dad6d604520c91586334c9c230366a14 (patch)
tree091e848fd2604b1cfaf1bfba80f07c3535f7ae4c /drivers/target/iscsi/iscsi_target_core.h
parentiscsi-target: Add login negotiation multi-plexing support (diff)
downloadkernel-qcow2-linux-bb048357dad6d604520c91586334c9c230366a14.tar.gz
kernel-qcow2-linux-bb048357dad6d604520c91586334c9c230366a14.tar.xz
kernel-qcow2-linux-bb048357dad6d604520c91586334c9c230366a14.zip
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>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_core.h')
-rw-r--r--drivers/target/iscsi/iscsi_target_core.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h
index 43228dc786c9..089a0e915da8 100644
--- a/drivers/target/iscsi/iscsi_target_core.h
+++ b/drivers/target/iscsi/iscsi_target_core.h
@@ -555,11 +555,13 @@ struct iscsi_conn {
/* socket used by this connection */
struct socket *sock;
void (*orig_data_ready)(struct sock *, int);
+ void (*orig_state_change)(struct sock *);
#define LOGIN_FLAGS_READ_ACTIVE 1
#define LOGIN_FLAGS_CLOSED 2
#define LOGIN_FLAGS_READY 4
unsigned long login_flags;
struct delayed_work login_work;
+ struct delayed_work login_cleanup_work;
struct iscsi_login *login;
struct timer_list nopin_timer;
struct timer_list nopin_response_timer;