From cb4ad5f7747a673dcebd1540db92e972015f0330 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Tue, 19 May 2015 19:21:26 -0700 Subject: [PATCH] Connect: Don't use the TUR checks on re-connects Only use TUR to eat any pending unit attentions on the initial connect but not during reconnect. From Peter Lieven Signed-off-by: Ronnie Sahlberg --- lib/connect.c | 2 +- lib/iscsi-command.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/connect.c b/lib/connect.c index 2fecb6c..8afe77b 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -130,7 +130,7 @@ iscsi_login_cb(struct iscsi_context *iscsi, int status, void *command_data _U_, return; } - if (ct->lun != -1) { + if (ct->lun != -1 && !iscsi->old_iscsi) { if (iscsi_testunitready_task(iscsi, ct->lun, iscsi_testunitready_cb, ct) == NULL) { iscsi_set_error(iscsi, "iscsi_testunitready_async failed."); diff --git a/lib/iscsi-command.c b/lib/iscsi-command.c index aefa327..3480ac1 100644 --- a/lib/iscsi-command.c +++ b/lib/iscsi-command.c @@ -206,8 +206,7 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun, struct iscsi_pdu *pdu; int flags; - if (iscsi->old_iscsi && - (iscsi->is_loggedin == 0 || task->cdb[0] != SCSI_OPCODE_TESTUNITREADY)) { + if (iscsi->old_iscsi) { iscsi = iscsi->old_iscsi; ISCSI_LOG(iscsi, 2, "iscsi_scsi_command_async: queuing cmd to old_iscsi while reconnecting"); }