summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_rd.c
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2015-03-28 09:15:04 +0300
committerNicholas Bellinger <nab@linux-iscsi.org>2015-04-08 09:27:45 +0300
commit1762742f3fd276570456eb669922e34e11bd98b7 (patch)
treee16588ef7c676b30113e341bf059f2c6991d757b /drivers/target/target_core_rd.c
parent6f16ec43e06e37dc5c3bed52ae76803c13ee2f8c (diff)
downloadlinux-1762742f3fd276570456eb669922e34e11bd98b7.tar.xz
target/rd: Add checks for backend DIF emulation
Make sure that RAMDISK only attempts to use backend DIF emulation when it's actually enabled at device level. Cc: Martin Petersen <martin.petersen@oracle.com> Cc: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_rd.c')
-rw-r--r--drivers/target/target_core_rd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/target/target_core_rd.c b/drivers/target/target_core_rd.c
index 98e83ac5661b..bedd4a18b3ca 100644
--- a/drivers/target/target_core_rd.c
+++ b/drivers/target/target_core_rd.c
@@ -419,7 +419,8 @@ rd_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
data_direction == DMA_FROM_DEVICE ? "Read" : "Write",
cmd->t_task_lba, rd_size, rd_page, rd_offset);
- if (cmd->prot_type && data_direction == DMA_TO_DEVICE) {
+ if (cmd->prot_type && se_dev->dev_attrib.pi_prot_type &&
+ data_direction == DMA_TO_DEVICE) {
struct rd_dev_sg_table *prot_table;
struct scatterlist *prot_sg;
u32 sectors = cmd->data_length / se_dev->dev_attrib.block_size;
@@ -502,7 +503,8 @@ rd_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
}
sg_miter_stop(&m);
- if (cmd->prot_type && data_direction == DMA_FROM_DEVICE) {
+ if (cmd->prot_type && se_dev->dev_attrib.pi_prot_type &&
+ data_direction == DMA_FROM_DEVICE) {
struct rd_dev_sg_table *prot_table;
struct scatterlist *prot_sg;
u32 sectors = cmd->data_length / se_dev->dev_attrib.block_size;