diff options
Diffstat (limited to 'drivers/target/target_core_xcopy.c')
-rw-r--r-- | drivers/target/target_core_xcopy.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 0e41143fc16e..474cd44fac14 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c | |||
@@ -893,6 +893,7 @@ sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) | |||
893 | struct xcopy_op *xop = NULL; | 893 | struct xcopy_op *xop = NULL; |
894 | unsigned char *p = NULL, *seg_desc; | 894 | unsigned char *p = NULL, *seg_desc; |
895 | unsigned int list_id, list_id_usage, sdll, inline_dl, sa; | 895 | unsigned int list_id, list_id_usage, sdll, inline_dl, sa; |
896 | sense_reason_t ret = TCM_INVALID_PARAMETER_LIST; | ||
896 | int rc; | 897 | int rc; |
897 | unsigned short tdll; | 898 | unsigned short tdll; |
898 | 899 | ||
@@ -944,6 +945,17 @@ sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) | |||
944 | if (rc <= 0) | 945 | if (rc <= 0) |
945 | goto out; | 946 | goto out; |
946 | 947 | ||
948 | if (xop->src_dev->dev_attrib.block_size != | ||
949 | xop->dst_dev->dev_attrib.block_size) { | ||
950 | pr_err("XCOPY: Non matching src_dev block_size: %u + dst_dev" | ||
951 | " block_size: %u currently unsupported\n", | ||
952 | xop->src_dev->dev_attrib.block_size, | ||
953 | xop->dst_dev->dev_attrib.block_size); | ||
954 | xcopy_pt_undepend_remotedev(xop); | ||
955 | ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | ||
956 | goto out; | ||
957 | } | ||
958 | |||
947 | pr_debug("XCOPY: Processed %d target descriptors, length: %u\n", rc, | 959 | pr_debug("XCOPY: Processed %d target descriptors, length: %u\n", rc, |
948 | rc * XCOPY_TARGET_DESC_LEN); | 960 | rc * XCOPY_TARGET_DESC_LEN); |
949 | seg_desc = &p[16]; | 961 | seg_desc = &p[16]; |
@@ -966,7 +978,7 @@ out: | |||
966 | if (p) | 978 | if (p) |
967 | transport_kunmap_data_sg(se_cmd); | 979 | transport_kunmap_data_sg(se_cmd); |
968 | kfree(xop); | 980 | kfree(xop); |
969 | return TCM_INVALID_PARAMETER_LIST; | 981 | return ret; |
970 | } | 982 | } |
971 | 983 | ||
972 | static sense_reason_t target_rcr_operating_parameters(struct se_cmd *se_cmd) | 984 | static sense_reason_t target_rcr_operating_parameters(struct se_cmd *se_cmd) |