On Thu, 2018-06-21 at 14:10 -0500, Mike Christie wrote: > > > > @@ -3156,9 +3167,13 @@ static int translate_sense_reason(struct se_cmd *cmd, sense_reason_t reason) > > si = &sense_info_table[(__force int) > > TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE]; > > > > + key = si->key; > > if (reason == TCM_CHECK_CONDITION_UNIT_ATTENTION) { > > - core_scsi3_ua_for_check_condition(cmd, &asc, &ascq); > > - WARN_ON_ONCE(asc == 0); > > + if (!core_scsi3_ua_for_check_condition(cmd, &key, &asc, > > + &ascq)) { > > + cmd->scsi_status = SAM_STAT_BUSY; > > Here is another question I had about this code path. > > If you hit this case do you need to undo the setting of the > SCF_SENT_CHECK_CONDITION bit done in > transport_send_check_condition_and_sense or does the check for that bit > need to be fixed up. > > With the code addition above we have this path setting > SCF_SENT_CHECK_CONDITION so > iscsit_check_task_reassign_expdatasn/iscsit_task_reassign_complete_scsi_cmnd/ > transport_send_task_abort would see the CC bit set and return. Hello Mike, Have you noticed that patch 1/3 that was attached to my previous e-mail moves the code that sets the SCF_SENT_CHECK_CONDITION flag inside translate_sense_reason() and past the point where SAM_STAT_BUSY is returned? > > * The highest priority Unit Attentions are placed at the head of the > > @@ -244,6 +246,7 @@ void core_scsi3_ua_for_check_condition( > > * clearing it. > > */ > > if (dev->dev_attrib.emulate_ua_intlck_ctrl != 0) { > > + *key = UNIT_ATTENTION; > > > Is the key already set to UNIT_ATTENTION here? Good catch - that assignment is superfluous. But I would like to keep it because I think it makes the core_scsi3_ua_for_check_condition() easy to read. However, that assignment makes the following entry in sense_info_table[] superfluous: [TCM_CHECK_CONDITION_UNIT_ATTENTION] = { .key = UNIT_ATTENTION, }, Bart.��.n��������+%������w��{.n����j�����{ay�ʇڙ���f���h������_�(�階�ݢj"��������G����?���&��