diff options
-rw-r--r-- | drivers/target/target_core_xcopy.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index fe985559eeb8..eeeaf99387ce 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c | |||
@@ -82,6 +82,9 @@ static int target_xcopy_locate_se_dev_e4(struct se_cmd *se_cmd, struct xcopy_op | |||
82 | mutex_lock(&g_device_mutex); | 82 | mutex_lock(&g_device_mutex); |
83 | list_for_each_entry(se_dev, &g_device_list, g_dev_node) { | 83 | list_for_each_entry(se_dev, &g_device_list, g_dev_node) { |
84 | 84 | ||
85 | if (!se_dev->dev_attrib.emulate_3pc) | ||
86 | continue; | ||
87 | |||
85 | memset(&tmp_dev_wwn[0], 0, XCOPY_NAA_IEEE_REGEX_LEN); | 88 | memset(&tmp_dev_wwn[0], 0, XCOPY_NAA_IEEE_REGEX_LEN); |
86 | target_xcopy_gen_naa_ieee(se_dev, &tmp_dev_wwn[0]); | 89 | target_xcopy_gen_naa_ieee(se_dev, &tmp_dev_wwn[0]); |
87 | 90 | ||
@@ -884,12 +887,18 @@ out: | |||
884 | 887 | ||
885 | sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) | 888 | sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) |
886 | { | 889 | { |
890 | struct se_device *dev = se_cmd->se_dev; | ||
887 | struct xcopy_op *xop = NULL; | 891 | struct xcopy_op *xop = NULL; |
888 | unsigned char *p = NULL, *seg_desc; | 892 | unsigned char *p = NULL, *seg_desc; |
889 | unsigned int list_id, list_id_usage, sdll, inline_dl, sa; | 893 | unsigned int list_id, list_id_usage, sdll, inline_dl, sa; |
890 | int rc; | 894 | int rc; |
891 | unsigned short tdll; | 895 | unsigned short tdll; |
892 | 896 | ||
897 | if (!dev->dev_attrib.emulate_3pc) { | ||
898 | pr_err("EXTENDED_COPY operation explicitly disabled\n"); | ||
899 | return TCM_UNSUPPORTED_SCSI_OPCODE; | ||
900 | } | ||
901 | |||
893 | sa = se_cmd->t_task_cdb[1] & 0x1f; | 902 | sa = se_cmd->t_task_cdb[1] & 0x1f; |
894 | if (sa != 0x00) { | 903 | if (sa != 0x00) { |
895 | pr_err("EXTENDED_COPY(LID4) not supported\n"); | 904 | pr_err("EXTENDED_COPY(LID4) not supported\n"); |