]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
tcmu: fix sense handling during completion
authorMike Christie <mchristi@redhat.com>
Wed, 31 May 2017 20:52:40 +0000 (15:52 -0500)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 7 Jul 2017 06:11:46 +0000 (23:11 -0700)
We were just copying the sense to the cmd sense_buffer and
did not implement a transport_complete or set the
SCF_TRANSPORT_TASK_SENSE, so the sense was ignored.

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

index a8ff6b5fdec8f425ed79a0c924d271321fcf593f..cbbfba0c135272d22ff8fae981703dd72f270874 100644 (file)
@@ -956,8 +956,7 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry *
                        cmd->se_cmd);
                entry->rsp.scsi_status = SAM_STAT_CHECK_CONDITION;
        } else if (entry->rsp.scsi_status == SAM_STAT_CHECK_CONDITION) {
-               memcpy(se_cmd->sense_buffer, entry->rsp.sense_buffer,
-                              se_cmd->scsi_sense_length);
+               transport_copy_sense_to_cmd(se_cmd, entry->rsp.sense_buffer);
        } else if (se_cmd->se_cmd_flags & SCF_BIDI) {
                /* Get Data-In buffer before clean up */
                gather_data_area(udev, cmd, true);