From 6f16ec43e06e37dc5c3bed52ae76803c13ee2f8c Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Fri, 27 Mar 2015 23:14:16 -0700 Subject: [PATCH] target/iblock: Add checks for backend DIF emulation Make sure that IBLOCK only attempts to use backend DIF emulation when it's actually enabled at device level. Cc: Martin Petersen Cc: Sagi Grimberg Cc: Christoph Hellwig Signed-off-by: Nicholas Bellinger --- drivers/target/target_core_iblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 2520cbfba524..1b7947c2510f 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -774,7 +774,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, sg_num--; } - if (cmd->prot_type) { + if (cmd->prot_type && dev->dev_attrib.pi_prot_type) { int rc = iblock_alloc_bip(cmd, bio_start); if (rc) goto fail_put_bios; -- 2.20.1