瀏覽代碼

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 <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>
Nicholas Bellinger 10 年之前
父節點
當前提交
6f16ec43e0
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/target/target_core_iblock.c

+ 1 - 1
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;