Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When Initiator ping(noop out) failed, linux kernel will call stop_conn and recover session. Tgt will rebuild session info(in it_nexus_create) and add the ua sense(ASC_POWERON_RESET) to pending_ua_sense_list. But, tgt Set ASC_POWERON_RESET ua sense will make scsi command fast failed, after session recovery.
After recovery, first scmd request will get the ASC_POWERON_RESET(ua sense) and response with SAM_STAT_CHECK_CONDITION status. SCSI module will return IO-error to upper layer without retry, because of
expecting_cc_ua = 0
in struct scsi_device(in kernel scsi module).According to linux kernel code
scsi_done --> scsi_complete --> scsi_decide_disposition --> scsi_check_sense
, if expecting_cc_ua = 0, scmd response with ASC_POWERON_RESET(ua sense) do not NEEDS_RETRY. It make scmd fast failed, although lun(session)has recovered to normal.In addition, tgt has setted ASC_POWERON_RESET ua sense for LOGICAL_UNIT_RESET and CLEAR_TASK_SET device reset operation (in target_mgmt_request funtion).