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:
parent
024809d454
commit
6ceb55fad0
|
@ -727,8 +727,8 @@ static void iscsi_rx_login_response ( struct iscsi_session *iscsi, void *data,
|
||||||
|
|
||||||
/* Check for fatal errors */
|
/* Check for fatal errors */
|
||||||
if ( response->status_class != 0 ) {
|
if ( response->status_class != 0 ) {
|
||||||
printf ( "iSCSI login failure: class %02x detail %02x\n",
|
DBG ( "iSCSI login failure: class %02x detail %02x\n",
|
||||||
response->status_class, response->status_detail );
|
response->status_class, response->status_detail );
|
||||||
iscsi_done ( iscsi, -EPERM );
|
iscsi_done ( iscsi, -EPERM );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1172,9 +1172,20 @@ struct async_operation * iscsi_issue ( struct iscsi_session *iscsi,
|
||||||
iscsi->command = command;
|
iscsi->command = command;
|
||||||
|
|
||||||
if ( iscsi->status ) {
|
if ( iscsi->status ) {
|
||||||
iscsi_start_command ( iscsi );
|
if ( ( iscsi->status & ISCSI_STATUS_PHASE_MASK ) ==
|
||||||
tcp_senddata ( &iscsi->tcp );
|
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 {
|
} else {
|
||||||
|
/* Session not open: initiate login */
|
||||||
iscsi->tcp.tcp_op = &iscsi_tcp_operations;
|
iscsi->tcp.tcp_op = &iscsi_tcp_operations;
|
||||||
tcp_connect ( &iscsi->tcp );
|
tcp_connect ( &iscsi->tcp );
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue