Commit 6abbdf38 authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Nicholas Bellinger

target: go through normal processing for zero-length REQUEST_SENSE

Now that spc_emulate_request_sense has been taught to process zero-length
REQUEST SENSE correctly, drop the special handling of unit attention
conditions from transport_generic_new_cmd.  However, for now REQUEST SENSE
will be the only command that goes through emulation for zero lengths.

(nab: Fix up zero-length check in transport_generic_new_cmd)
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 32a8811f
...@@ -2306,20 +2306,13 @@ int transport_generic_new_cmd(struct se_cmd *cmd) ...@@ -2306,20 +2306,13 @@ int transport_generic_new_cmd(struct se_cmd *cmd)
* away. * away.
*/ */
if (!cmd->data_length && if (!cmd->data_length &&
(cmd->se_dev->transport->transport_type != TRANSPORT_PLUGIN_PHBA_PDEV || cmd->t_task_cdb[0] != REQUEST_SENSE &&
cmd->t_task_cdb[0] == REPORT_LUNS) { cmd->se_dev->transport->transport_type != TRANSPORT_PLUGIN_PHBA_PDEV) {
spin_lock_irq(&cmd->t_state_lock); spin_lock_irq(&cmd->t_state_lock);
cmd->t_state = TRANSPORT_COMPLETE; cmd->t_state = TRANSPORT_COMPLETE;
cmd->transport_state |= CMD_T_ACTIVE; cmd->transport_state |= CMD_T_ACTIVE;
spin_unlock_irq(&cmd->t_state_lock); spin_unlock_irq(&cmd->t_state_lock);
if (cmd->t_task_cdb[0] == REQUEST_SENSE) {
u8 ua_asc = 0, ua_ascq = 0;
core_scsi3_ua_clear_for_request_sense(cmd,
&ua_asc, &ua_ascq);
}
INIT_WORK(&cmd->work, target_complete_ok_work); INIT_WORK(&cmd->work, target_complete_ok_work);
queue_work(target_completion_wq, &cmd->work); queue_work(target_completion_wq, &cmd->work);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment