target: do not require a transport_complete for SCF_TRANSPORT_TASK_SENSE
authorMike Christie <mchristi@redhat.com>
Wed, 31 May 2017 20:52:38 +0000 (15:52 -0500)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 7 Jul 2017 06:11:44 +0000 (23:11 -0700)
tcmu needs to pass raw sense to target_complete_cmd, but a a
transport_complete callout is akward to implement for it.

This moves the check for SCF_TRANSPORT_TASK_SENSE so any backend
can pass sense.

Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c

index 28de421e3220cdd3ead2805fd41497eb26d3eba0..a8f943e325eb3f97340f1907d7ed8315b63514c8 100644 (file)
@@ -719,9 +719,9 @@ void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status)
                dev->transport->transport_complete(cmd,
                                cmd->t_data_sg,
                                transport_get_sense_buffer(cmd));
-               if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE)
-                       success = 1;
        }
+       if (cmd->se_cmd_flags & SCF_TRANSPORT_TASK_SENSE)
+               success = 1;
 
        /*
         * Check for case where an explicit ABORT_TASK has been received