Commit 366bda19 authored by Nicholas Bellinger's avatar Nicholas Bellinger

target: Add missing XCOPY I/O operation sense_buffer

This patch adds the missing xcopy_pt_cmd->sense_buffer[] required for
correctly handling CHECK_CONDITION exceptions within the locally
generated XCOPY I/O path.

Also update target_xcopy_read_source() + target_xcopy_setup_pt_cmd()
to pass this buffer into transport_init_se_cmd() to correctly setup
se_cmd->sense_buffer.
Reported-by: default avatarThomas Glanzmann <thomas@glanzmann.de>
Reported-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
Cc: Thomas Glanzmann <thomas@glanzmann.de>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 0a66614b
...@@ -360,6 +360,7 @@ struct xcopy_pt_cmd { ...@@ -360,6 +360,7 @@ struct xcopy_pt_cmd {
struct se_cmd se_cmd; struct se_cmd se_cmd;
struct xcopy_op *xcopy_op; struct xcopy_op *xcopy_op;
struct completion xpt_passthrough_sem; struct completion xpt_passthrough_sem;
unsigned char sense_buffer[TRANSPORT_SENSE_BUFFER];
}; };
static struct se_port xcopy_pt_port; static struct se_port xcopy_pt_port;
...@@ -711,7 +712,7 @@ static int target_xcopy_read_source( ...@@ -711,7 +712,7 @@ static int target_xcopy_read_source(
(unsigned long long)src_lba, src_sectors, length); (unsigned long long)src_lba, src_sectors, length);
transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length, transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length,
DMA_FROM_DEVICE, 0, NULL); DMA_FROM_DEVICE, 0, &xpt_cmd->sense_buffer[0]);
xop->src_pt_cmd = xpt_cmd; xop->src_pt_cmd = xpt_cmd;
rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, src_dev, &cdb[0], rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, src_dev, &cdb[0],
...@@ -771,7 +772,7 @@ static int target_xcopy_write_destination( ...@@ -771,7 +772,7 @@ static int target_xcopy_write_destination(
(unsigned long long)dst_lba, dst_sectors, length); (unsigned long long)dst_lba, dst_sectors, length);
transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length, transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length,
DMA_TO_DEVICE, 0, NULL); DMA_TO_DEVICE, 0, &xpt_cmd->sense_buffer[0]);
xop->dst_pt_cmd = xpt_cmd; xop->dst_pt_cmd = xpt_cmd;
rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, dst_dev, &cdb[0], rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, dst_dev, &cdb[0],
......
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