From: Nicholas Bellinger Date: Sat, 28 Mar 2015 06:14:16 +0000 (-0700) Subject: target/iblock: Add checks for backend DIF emulation X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=6f16ec43e06e37dc5c3bed52ae76803c13ee2f8c;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 --- 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;