iscsi: handle check condition status in retry loop

The handling of check condition was incorrect because
we would only do it after retries exceed maximum.

Fixes: 8c460269aa ("iscsi: base all handling of check condition on scsi_sense_to_errno")
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Message-Id: <20200701105444.3226-1-xieyongji@bytedance.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Xie Yongji 2020-07-01 18:54:43 +08:00 committed by Paolo Bonzini
parent 1b38750c40
commit dd3b00202a

View File

@ -266,7 +266,6 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
timer_mod(&iTask->retry_timer,
qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + retry_time);
iTask->do_retry = 1;
}
} else if (status == SCSI_STATUS_CHECK_CONDITION) {
int error = iscsi_translate_sense(&task->sense);
if (error == EAGAIN) {
@ -279,6 +278,7 @@ iscsi_co_generic_cb(struct iscsi_context *iscsi, int status,
}
}
}
}
if (iTask->co) {
replay_bh_schedule_oneshot_event(iTask->iscsilun->aio_context,