david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

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.
This commit is contained in:
Michael Brown 2006-12-21 17:43:43 +00:00
parent 024809d454
commit 6ceb55fad0
1 changed files with 15 additions and 4 deletions

View File

@ -727,8 +727,8 @@ static void iscsi_rx_login_response ( struct iscsi_session *iscsi, void *data,
/* Check for fatal errors */
if ( response->status_class != 0 ) {
printf ( "iSCSI login failure: class %02x detail %02x\n",
response->status_class, response->status_detail );
DBG ( "iSCSI login failure: class %02x detail %02x\n",
response->status_class, response->status_detail );
iscsi_done ( iscsi, -EPERM );
return;
}
@ -1172,9 +1172,20 @@ struct async_operation * iscsi_issue ( struct iscsi_session *iscsi,
iscsi->command = command;
if ( iscsi->status ) {
iscsi_start_command ( iscsi );
tcp_senddata ( &iscsi->tcp );
if ( ( iscsi->status & ISCSI_STATUS_PHASE_MASK ) ==
ISCSI_STATUS_FULL_FEATURE_PHASE ) {
/* Session already open: issue command */
iscsi_start_command ( iscsi );
tcp_senddata ( &iscsi->tcp );
} else {
/* Session failed to reach full feature phase:
* abort immediately rather than retrying the
* login.
*/
iscsi_done ( iscsi, -EPERM );
}
} else {
/* Session not open: initiate login */
iscsi->tcp.tcp_op = &iscsi_tcp_operations;
tcp_connect ( &iscsi->tcp );
}