Certain iSCSI commands such as NOP and LOGOUT commands are discarded instead of re-queued when we have a session failure and reconnect. Change the LOGOUT command to instead fail with SCSI_STATUS_ERROR when this happens. Otherwise, IF we are in iscsi_logout_sync() and we get a session failure at the same-ish time we may end up automatically re-connecting the session, but since we have discarded the logout command we will never get a reply and will hang indefinitely in the event loop for synchronous commands. Arguably, we could also just return SCSI_STATUS_GOOD here since when we perform a logout, we probably don't care too much about how we disconnected from the server, only that we did disconnect from the server. That is academic anyway since this only affects the sync API which is only meant for trivial applications, which will likely not inspect the result and just do a: ... iscsi_logout_sync() iscsi_destroy_context() ... anyway. Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
14 KiB
14 KiB