diff options
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_login.c')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_login.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 316f66172335..bc2cbffec27e 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c | |||
@@ -195,6 +195,7 @@ int iscsi_check_for_session_reinstatement(struct iscsi_conn *conn) | |||
195 | initiatorname_param->value) && | 195 | initiatorname_param->value) && |
196 | (sess_p->sess_ops->SessionType == sessiontype))) { | 196 | (sess_p->sess_ops->SessionType == sessiontype))) { |
197 | atomic_set(&sess_p->session_reinstatement, 1); | 197 | atomic_set(&sess_p->session_reinstatement, 1); |
198 | atomic_set(&sess_p->session_fall_back_to_erl0, 1); | ||
198 | spin_unlock(&sess_p->conn_lock); | 199 | spin_unlock(&sess_p->conn_lock); |
199 | iscsit_inc_session_usage_count(sess_p); | 200 | iscsit_inc_session_usage_count(sess_p); |
200 | iscsit_stop_time2retain_timer(sess_p); | 201 | iscsit_stop_time2retain_timer(sess_p); |
@@ -1218,9 +1219,11 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) | |||
1218 | flush_signals(current); | 1219 | flush_signals(current); |
1219 | 1220 | ||
1220 | spin_lock_bh(&np->np_thread_lock); | 1221 | spin_lock_bh(&np->np_thread_lock); |
1221 | if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { | 1222 | if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { |
1222 | np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; | 1223 | np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; |
1224 | spin_unlock_bh(&np->np_thread_lock); | ||
1223 | complete(&np->np_restart_comp); | 1225 | complete(&np->np_restart_comp); |
1226 | return 1; | ||
1224 | } else if (np->np_thread_state == ISCSI_NP_THREAD_SHUTDOWN) { | 1227 | } else if (np->np_thread_state == ISCSI_NP_THREAD_SHUTDOWN) { |
1225 | spin_unlock_bh(&np->np_thread_lock); | 1228 | spin_unlock_bh(&np->np_thread_lock); |
1226 | goto exit; | 1229 | goto exit; |
@@ -1253,7 +1256,8 @@ static int __iscsi_target_login_thread(struct iscsi_np *np) | |||
1253 | goto exit; | 1256 | goto exit; |
1254 | } else if (rc < 0) { | 1257 | } else if (rc < 0) { |
1255 | spin_lock_bh(&np->np_thread_lock); | 1258 | spin_lock_bh(&np->np_thread_lock); |
1256 | if (np->np_thread_state == ISCSI_NP_THREAD_RESET) { | 1259 | if (atomic_dec_if_positive(&np->np_reset_count) >= 0) { |
1260 | np->np_thread_state = ISCSI_NP_THREAD_ACTIVE; | ||
1257 | spin_unlock_bh(&np->np_thread_lock); | 1261 | spin_unlock_bh(&np->np_thread_lock); |
1258 | complete(&np->np_restart_comp); | 1262 | complete(&np->np_restart_comp); |
1259 | iscsit_put_transport(conn->conn_transport); | 1263 | iscsit_put_transport(conn->conn_transport); |
@@ -1435,5 +1439,9 @@ int iscsi_target_login_thread(void *arg) | |||
1435 | break; | 1439 | break; |
1436 | } | 1440 | } |
1437 | 1441 | ||
1442 | while (!kthread_should_stop()) { | ||
1443 | msleep(100); | ||
1444 | } | ||
1445 | |||
1438 | return 0; | 1446 | return 0; |
1439 | } | 1447 | } |