From patchwork Mon Mar 30 03:28:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 6118371 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CB702BF4A7 for ; Mon, 30 Mar 2015 03:29:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EF1E220357 for ; Mon, 30 Mar 2015 03:29:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 00B282037C for ; Mon, 30 Mar 2015 03:29:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752890AbbC3D3r (ORCPT ); Sun, 29 Mar 2015 23:29:47 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:36785 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752723AbbC3D3d (ORCPT ); Sun, 29 Mar 2015 23:29:33 -0400 Received: by oicf142 with SMTP id f142so107796984oic.3 for ; Sun, 29 Mar 2015 20:29:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=P7bKuIjM/4/7vKerfthwSa9tTCeB1y4wWjWeMzu5Uv4=; b=EmOjZdnVot/bgium2EU87BQmWRgvXiR/2rRdGFAXIB1aK3QhQhwp1ZJ3//6aJv+mNN wX/lpRJcAvp26MjPKZy/rYhxanYY3RJwl90+j002HG0h+nIiREFmJEI6wpFGbT6cdrb0 vO35yRMtNgN3jyuG3rUf9rZZUc6Lv/6QUyNZxKzpM+0gQBhNRtekHhzJePUme7vc7IC0 AoAJtHsZocet36PBy+pgo+7xaeVZHNc0Pj/ZMFAPNhZbRjbXY4hPAjX/SIMuU6gSrZO7 iuny453PXRRwplYYXVXrPHQJSY43RuZov0uruOLvJfQFfocQW7nR93QKvniYVfORuxRL hDTQ== X-Gm-Message-State: ALoCoQnnxf+PE8U9qss/7ZASHs5ACwVD1EiizRNZUUYM3W3hoDnIvHr0lhaEsvJuGQGf9cHnxNDM X-Received: by 10.60.161.36 with SMTP id xp4mr16152204oeb.61.1427686173532; Sun, 29 Mar 2015 20:29:33 -0700 (PDT) Received: from localhost.localdomain (mail.linux-iscsi.org. [67.23.28.174]) by mx.google.com with ESMTPSA id wc6sm5439898obc.8.2015.03.29.20.29.33 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 29 Mar 2015 20:29:33 -0700 (PDT) From: "Nicholas A. Bellinger" To: target-devel Cc: linux-scsi , "Martin K. Petersen" , Sagi Grimberg , Quinn Tran , Nicholas Bellinger , Christoph Hellwig Subject: [PATCH-v2 09/15] target/iblock: Add checks for backend DIF emulation Date: Mon, 30 Mar 2015 03:28:18 +0000 Message-Id: <1427686104-14231-10-git-send-email-nab@daterainc.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1427686104-14231-1-git-send-email-nab@daterainc.com> References: <1427686104-14231-1-git-send-email-nab@daterainc.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nicholas Bellinger 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 2520cbf..1b7947c 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;