target/iblock: Add checks for backend DIF emulation
authorNicholas Bellinger <nab@linux-iscsi.org>
Sat, 28 Mar 2015 06:14:16 +0000 (23:14 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 8 Apr 2015 06:27:44 +0000 (23:27 -0700)
Make sure that IBLOCK 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>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_iblock.c

index 2520cbfba524300647353f7c19f02dacf7ce1e89..1b7947c2510fc8c65872127738c83ccbb34cf6a3 100644 (file)
@@ -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;