Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287352
b: refs/heads/master
c: 91ec1d3
h: refs/heads/master
v: v3
  • Loading branch information
Nicholas Bellinger committed Jan 18, 2012
1 parent d36e50b commit 5638276
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9fbc8909876a2160044e71d376848973b9bfdc3f
refs/heads/master: 91ec1d3535b2acf12c599045cc19ad9be3c6a47b
13 changes: 13 additions & 0 deletions trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -3759,6 +3759,11 @@ transport_allocate_control_task(struct se_cmd *cmd)
struct se_task *task;
unsigned long flags;

/* Workaround for handling zero-length control CDBs */
if ((cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB) &&
!cmd->data_length)
return 0;

task = transport_generic_get_task(cmd, cmd->data_direction);
if (!task)
return -ENOMEM;
Expand Down Expand Up @@ -3830,6 +3835,14 @@ int transport_generic_new_cmd(struct se_cmd *cmd)
else if (!task_cdbs && (cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB)) {
cmd->t_state = TRANSPORT_COMPLETE;
atomic_set(&cmd->t_transport_active, 1);

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);
queue_work(target_completion_wq, &cmd->work);
return 0;
Expand Down

0 comments on commit 5638276

Please sign in to comment.