Kaynağa Gözat

When login fails, leave the session open but not in full feature

phase.  In iscsi_issue(), detect this state and immediately refuse the
operation.  This avoids trying multiple logins when scsi.c tries
several times to read the drive capacity.
tags/v0.9.3
Michael Brown 18 yıl önce
ebeveyn
işleme
6ceb55fad0
1 değiştirilmiş dosya ile 15 ekleme ve 4 silme
  1. 15
    4
      src/net/tcp/iscsi.c

+ 15
- 4
src/net/tcp/iscsi.c Dosyayı Görüntüle

@@ -727,8 +727,8 @@ static void iscsi_rx_login_response ( struct iscsi_session *iscsi, void *data,
727 727
 
728 728
 	/* Check for fatal errors */
729 729
 	if ( response->status_class != 0 ) {
730
-		printf ( "iSCSI login failure: class %02x detail %02x\n",
731
-			 response->status_class, response->status_detail );
730
+		DBG ( "iSCSI login failure: class %02x detail %02x\n",
731
+		      response->status_class, response->status_detail );
732 732
 		iscsi_done ( iscsi, -EPERM );
733 733
 		return;
734 734
 	}
@@ -1172,9 +1172,20 @@ struct async_operation * iscsi_issue ( struct iscsi_session *iscsi,
1172 1172
 	iscsi->command = command;
1173 1173
 
1174 1174
 	if ( iscsi->status ) {
1175
-		iscsi_start_command ( iscsi );
1176
-		tcp_senddata ( &iscsi->tcp );
1175
+		if ( ( iscsi->status & ISCSI_STATUS_PHASE_MASK ) ==
1176
+		     ISCSI_STATUS_FULL_FEATURE_PHASE ) {
1177
+			/* Session already open: issue command */
1178
+			iscsi_start_command ( iscsi );
1179
+			tcp_senddata ( &iscsi->tcp );
1180
+		} else {
1181
+			/* Session failed to reach full feature phase:
1182
+			 * abort immediately rather than retrying the
1183
+			 * login.
1184
+			 */
1185
+			iscsi_done ( iscsi, -EPERM );
1186
+		}
1177 1187
 	} else {
1188
+		/* Session not open: initiate login */
1178 1189
 		iscsi->tcp.tcp_op = &iscsi_tcp_operations;
1179 1190
 		tcp_connect ( &iscsi->tcp );
1180 1191
 	}

Loading…
İptal
Kaydet