reconnect: do not queue TESTUNIT_READY cdbs

those are part of the login process to consume UNIT_ATTENTIONS.

Its questionable if we should consume them at all, but iff we change
that behaviour we should do it for the initial login as well as
for a reconnect.

Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
Peter Lieven
2015-04-13 10:06:32 +02:00
parent b3783b961b
commit 63fd8679fa
2 changed files with 3 additions and 2 deletions

View File

@@ -130,7 +130,7 @@ iscsi_login_cb(struct iscsi_context *iscsi, int status, void *command_data _U_,
return;
}
if (ct->lun != -1 && !iscsi->old_iscsi) {
if (ct->lun != -1) {
if (iscsi_testunitready_task(iscsi, ct->lun,
iscsi_testunitready_cb, ct) == NULL) {
iscsi_set_error(iscsi, "iscsi_testunitready_async failed.");

View File

@@ -206,7 +206,8 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
struct iscsi_pdu *pdu;
int flags;
if (iscsi->old_iscsi) {
if (iscsi->old_iscsi &&
(iscsi->is_loggedin == 0 || task->cdb[0] != SCSI_OPCODE_TESTUNITREADY)) {
iscsi = iscsi->old_iscsi;
ISCSI_LOG(iscsi, 2, "iscsi_scsi_command_async: queuing cmd to old_iscsi while reconnecting");
}