diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-09-07 11:30:37 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-09-07 14:32:54 -0400 |
commit | 6abbdf38363f064c8a50150c9b709682764483b3 (patch) | |
tree | 9b2d5d37bdda6ffeac9a7308e3468e9063773327 /drivers | |
parent | 32a8811ff164f882712c17946e58e52444f464a7 (diff) |
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: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/target/target_core_transport.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 4403477882b3..269f54488397 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -2306,20 +2306,13 @@ int transport_generic_new_cmd(struct se_cmd *cmd) | |||
2306 | * away. | 2306 | * away. |
2307 | */ | 2307 | */ |
2308 | if (!cmd->data_length && | 2308 | if (!cmd->data_length && |
2309 | (cmd->se_dev->transport->transport_type != TRANSPORT_PLUGIN_PHBA_PDEV || | 2309 | cmd->t_task_cdb[0] != REQUEST_SENSE && |
2310 | cmd->t_task_cdb[0] == REPORT_LUNS) { | 2310 | cmd->se_dev->transport->transport_type != TRANSPORT_PLUGIN_PHBA_PDEV) { |
2311 | spin_lock_irq(&cmd->t_state_lock); | 2311 | spin_lock_irq(&cmd->t_state_lock); |
2312 | cmd->t_state = TRANSPORT_COMPLETE; | 2312 | cmd->t_state = TRANSPORT_COMPLETE; |
2313 | cmd->transport_state |= CMD_T_ACTIVE; | 2313 | cmd->transport_state |= CMD_T_ACTIVE; |
2314 | spin_unlock_irq(&cmd->t_state_lock); | 2314 | spin_unlock_irq(&cmd->t_state_lock); |
2315 | 2315 | ||
2316 | if (cmd->t_task_cdb[0] == REQUEST_SENSE) { | ||
2317 | u8 ua_asc = 0, ua_ascq = 0; | ||
2318 | |||
2319 | core_scsi3_ua_clear_for_request_sense(cmd, | ||
2320 | &ua_asc, &ua_ascq); | ||
2321 | } | ||
2322 | |||
2323 | INIT_WORK(&cmd->work, target_complete_ok_work); | 2316 | INIT_WORK(&cmd->work, target_complete_ok_work); |
2324 | queue_work(target_completion_wq, &cmd->work); | 2317 | queue_work(target_completion_wq, &cmd->work); |
2325 | return 0; | 2318 | return 0; |