aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 047543cd3fc1..212fe2027a8c 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -546,6 +546,9 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
546 */ 546 */
547 task = conn->login_task; 547 task = conn->login_task;
548 else { 548 else {
549 if (session->state != ISCSI_STATE_LOGGED_IN)
550 return NULL;
551
549 BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE); 552 BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE);
550 BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED); 553 BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED);
551 554
@@ -2566,8 +2569,6 @@ static void iscsi_start_session_recovery(struct iscsi_session *session,
2566{ 2569{
2567 int old_stop_stage; 2570 int old_stop_stage;
2568 2571
2569 del_timer_sync(&conn->transport_timer);
2570
2571 mutex_lock(&session->eh_mutex); 2572 mutex_lock(&session->eh_mutex);
2572 spin_lock_bh(&session->lock); 2573 spin_lock_bh(&session->lock);
2573 if (conn->stop_stage == STOP_CONN_TERM) { 2574 if (conn->stop_stage == STOP_CONN_TERM) {
@@ -2585,13 +2586,17 @@ static void iscsi_start_session_recovery(struct iscsi_session *session,
2585 session->state = ISCSI_STATE_TERMINATE; 2586 session->state = ISCSI_STATE_TERMINATE;
2586 else if (conn->stop_stage != STOP_CONN_RECOVER) 2587 else if (conn->stop_stage != STOP_CONN_RECOVER)
2587 session->state = ISCSI_STATE_IN_RECOVERY; 2588 session->state = ISCSI_STATE_IN_RECOVERY;
2589 spin_unlock_bh(&session->lock);
2588 2590
2591 del_timer_sync(&conn->transport_timer);
2592 iscsi_suspend_tx(conn);
2593
2594 spin_lock_bh(&session->lock);
2589 old_stop_stage = conn->stop_stage; 2595 old_stop_stage = conn->stop_stage;
2590 conn->stop_stage = flag; 2596 conn->stop_stage = flag;
2591 conn->c_stage = ISCSI_CONN_STOPPED; 2597 conn->c_stage = ISCSI_CONN_STOPPED;
2592 spin_unlock_bh(&session->lock); 2598 spin_unlock_bh(&session->lock);
2593 2599
2594 iscsi_suspend_tx(conn);
2595 /* 2600 /*
2596 * for connection level recovery we should not calculate 2601 * for connection level recovery we should not calculate
2597 * header digest. conn->hdr_size used for optimization 2602 * header digest. conn->hdr_size used for optimization