diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-10-24 03:10:36 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-10-24 03:28:08 -0400 |
commit | 366bda191c344ec4d7a5b908cf047bc09639ad3d (patch) | |
tree | 8a6140f7dd9b5352810d77904182ef546e5e36ea | |
parent | 0a66614b937c4cfe98c68613259367bf402f368b (diff) |
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: Thomas Glanzmann <thomas@glanzmann.de>
Reported-by: Douglas Gilbert <dgilbert@interlog.com>
Cc: Thomas Glanzmann <thomas@glanzmann.de>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/target_core_xcopy.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index eeeaf99387ce..5edcd2bebee8 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c | |||
@@ -360,6 +360,7 @@ struct xcopy_pt_cmd { | |||
360 | struct se_cmd se_cmd; | 360 | struct se_cmd se_cmd; |
361 | struct xcopy_op *xcopy_op; | 361 | struct xcopy_op *xcopy_op; |
362 | struct completion xpt_passthrough_sem; | 362 | struct completion xpt_passthrough_sem; |
363 | unsigned char sense_buffer[TRANSPORT_SENSE_BUFFER]; | ||
363 | }; | 364 | }; |
364 | 365 | ||
365 | static struct se_port xcopy_pt_port; | 366 | static struct se_port xcopy_pt_port; |
@@ -711,7 +712,7 @@ static int target_xcopy_read_source( | |||
711 | (unsigned long long)src_lba, src_sectors, length); | 712 | (unsigned long long)src_lba, src_sectors, length); |
712 | 713 | ||
713 | transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length, | 714 | transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length, |
714 | DMA_FROM_DEVICE, 0, NULL); | 715 | DMA_FROM_DEVICE, 0, &xpt_cmd->sense_buffer[0]); |
715 | xop->src_pt_cmd = xpt_cmd; | 716 | xop->src_pt_cmd = xpt_cmd; |
716 | 717 | ||
717 | rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, src_dev, &cdb[0], | 718 | rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, src_dev, &cdb[0], |
@@ -771,7 +772,7 @@ static int target_xcopy_write_destination( | |||
771 | (unsigned long long)dst_lba, dst_sectors, length); | 772 | (unsigned long long)dst_lba, dst_sectors, length); |
772 | 773 | ||
773 | transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length, | 774 | transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length, |
774 | DMA_TO_DEVICE, 0, NULL); | 775 | DMA_TO_DEVICE, 0, &xpt_cmd->sense_buffer[0]); |
775 | xop->dst_pt_cmd = xpt_cmd; | 776 | xop->dst_pt_cmd = xpt_cmd; |
776 | 777 | ||
777 | rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, dst_dev, &cdb[0], | 778 | rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, dst_dev, &cdb[0], |