Commit b5d330a1 authored by Nicholas Bellinger's avatar Nicholas Bellinger Committed by Ben Hutchings

target: Use correct SCSI status during EXTENDED_COPY exception

commit 0583c261 upstream.

This patch adds the missing target_complete_cmd() SCSI status
parameter change in target_xcopy_do_work(), that was originally
missing in commit 926317de.

It correctly propigates up the correct SCSI status during
EXTENDED_COPY exception cases, instead of always using the
hardcoded SAM_STAT_CHECK_CONDITION from original code.

This is required for ESX host environments that expect to
hit SAM_STAT_RESERVATION_CONFLICT for certain scenarios,
and SAM_STAT_CHECK_CONDITION results in non-retriable
status for these cases.
Reported-by: default avatarNixon Vincent <nixon.vincent@calsoftinc.com>
Tested-by: default avatarNixon Vincent <nixon.vincent@calsoftinc.com>
Cc: Nixon Vincent <nixon.vincent@calsoftinc.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent fbe20cd7
...@@ -881,7 +881,7 @@ static void target_xcopy_do_work(struct work_struct *work) ...@@ -881,7 +881,7 @@ static void target_xcopy_do_work(struct work_struct *work)
" CHECK_CONDITION -> sending response\n", rc); " CHECK_CONDITION -> sending response\n", rc);
ec_cmd->scsi_status = SAM_STAT_CHECK_CONDITION; ec_cmd->scsi_status = SAM_STAT_CHECK_CONDITION;
} }
target_complete_cmd(ec_cmd, SAM_STAT_CHECK_CONDITION); target_complete_cmd(ec_cmd, ec_cmd->scsi_status);
} }
sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) sense_reason_t target_do_xcopy(struct se_cmd *se_cmd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment