diff options
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_cdb.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c index 4c1d3a98e894..40ad142f7cb3 100644 --- a/drivers/target/target_core_cdb.c +++ b/drivers/target/target_core_cdb.c | |||
@@ -1077,8 +1077,6 @@ target_emulate_unmap(struct se_task *task) | |||
1077 | size -= 16; | 1077 | size -= 16; |
1078 | } | 1078 | } |
1079 | 1079 | ||
1080 | task->task_scsi_status = GOOD; | ||
1081 | transport_complete_task(task, 1); | ||
1082 | err: | 1080 | err: |
1083 | transport_kunmap_first_data_page(cmd); | 1081 | transport_kunmap_first_data_page(cmd); |
1084 | 1082 | ||
@@ -1115,8 +1113,6 @@ target_emulate_write_same(struct se_task *task, u32 num_blocks) | |||
1115 | return ret; | 1113 | return ret; |
1116 | } | 1114 | } |
1117 | 1115 | ||
1118 | task->task_scsi_status = GOOD; | ||
1119 | transport_complete_task(task, 1); | ||
1120 | return 0; | 1116 | return 0; |
1121 | } | 1117 | } |
1122 | 1118 | ||
@@ -1228,8 +1224,14 @@ transport_emulate_control_cdb(struct se_task *task) | |||
1228 | 1224 | ||
1229 | if (ret < 0) | 1225 | if (ret < 0) |
1230 | return ret; | 1226 | return ret; |
1231 | task->task_scsi_status = GOOD; | 1227 | /* |
1232 | transport_complete_task(task, 1); | 1228 | * Handle the successful completion here unless a caller |
1229 | * has explictly requested an asychronous completion. | ||
1230 | */ | ||
1231 | if (!(cmd->se_cmd_flags & SCF_EMULATE_CDB_ASYNC)) { | ||
1232 | task->task_scsi_status = GOOD; | ||
1233 | transport_complete_task(task, 1); | ||
1234 | } | ||
1233 | 1235 | ||
1234 | return PYX_TRANSPORT_SENT_TO_TRANSPORT; | 1236 | return PYX_TRANSPORT_SENT_TO_TRANSPORT; |
1235 | } | 1237 | } |