Received: by 10.213.65.68 with SMTP id h4csp111895imn; Thu, 15 Mar 2018 11:06:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELtF5vvoY14OCmXwDRFKm3jm7+dlRPhk6bO8yMt927DRIWL7CsNSRQct4CpX4LIAtm7F6f5E X-Received: by 10.99.55.70 with SMTP id g6mr7381052pgn.284.1521137205037; Thu, 15 Mar 2018 11:06:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521137205; cv=none; d=google.com; s=arc-20160816; b=G2P8W8UOGcDpQTpx+hwRN4gliuVFRDh/5Pj8QuxCwxzNaYXvBgQ0DEgFQNln5PrxSi OW+4No9WMc3FnB9gQVoegP9HmrqFDgmhIwmnUA2B1CA2NCSBxbcfLOe80nje0R7mXTHv Nvb9bKeiQT6382CtnsNXPgFhWO7IsrM+uMBkuVE1emz14DC2eBqy9rlfy3fwGQoFB4g2 9NDABpmNUFim/aExXs2DaH5dJmESUbKqQH+72xPwSJUcVolcCuuEfDnG6QrMwkwWievz z2ZU9gTCq0wCRDkY9nFtBCVjL0i+oMEgnFr27pDIrQfLizRhOfRIp6JpmKH5KYJEo2KM isAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=vKyWREaqEFqCptP1l3Ql7egzOT5hBmUzsRRjyGRc3pI=; b=EO7+Ae66XdeW9nXxWvfnSKTdYMYQT1J6LE5bOE6D74qZNB/w0t6SCL4x46vniVe2EX 7RMhjI25GTM9XxRRnnTnTNLcIDqSUVIMNzhrn1ZIHOmWtHm/l/uGRKYP9L99hjLenfh2 VaSeMR72HedgN065SVZ5U+t803wuxlhfCKbPQP2vS9wao2CI2cOoF0980EcgzoUUQmCO oxAneBV+tH+LUxxaq54QjYj1qCYgckUrV9nJhN+pLITL0Leu86BqruKnMo4oQjl0D1EZ w0NqQZx4fuadR8aI/M50PwxAZnLeJjs/XZQ894OR6sgWNV2bsPIfiv/hX8NHdtnUOuOz NxrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16-v6si4335244pll.504.2018.03.15.11.06.29; Thu, 15 Mar 2018 11:06:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932423AbeCOSFc (ORCPT + 99 others); Thu, 15 Mar 2018 14:05:32 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50056 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751488AbeCOSFa (ORCPT ); Thu, 15 Mar 2018 14:05:30 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3074A406802A; Thu, 15 Mar 2018 18:05:30 +0000 (UTC) Received: from straylight.hirudinean.org (ovpn-122-26.rdu2.redhat.com [10.10.122.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4E4B82166BAE; Thu, 15 Mar 2018 18:05:29 +0000 (UTC) Date: Thu, 15 Mar 2018 11:05:27 -0700 From: Chris Leech To: Jianchao Wang Cc: lduncan@suse.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] scsi: iscsi_tcp: set BDI_CAP_STABLE_WRITES when data digest enabled Message-ID: <20180315180527.GC32176@straylight.hirudinean.org> Mail-Followup-To: Chris Leech , Jianchao Wang , lduncan@suse.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org References: <1520425743-1923-1-git-send-email-jianchao.w.wang@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1520425743-1923-1-git-send-email-jianchao.w.wang@oracle.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 15 Mar 2018 18:05:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 15 Mar 2018 18:05:30 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cleech@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 07, 2018 at 08:29:03PM +0800, Jianchao Wang wrote: > iscsi tcp will first send out data, then calculate and send data > digest. If we don't have BDI_CAP_STABLE_WRITES, the page cache will > be written in spite of the on going writeback. Consequently, wrong > digest will be got and sent to target. > > To fix this, set BDI_CAP_STABLE_WRITES when data digest is enabled > in iscsi_tcp .slave_configure callback. > > Signed-off-by: Jianchao Wang > --- > drivers/scsi/iscsi_tcp.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c > index 6198559..261c686 100644 > --- a/drivers/scsi/iscsi_tcp.c > +++ b/drivers/scsi/iscsi_tcp.c > @@ -37,6 +37,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -954,6 +955,12 @@ static int iscsi_sw_tcp_slave_alloc(struct scsi_device *sdev) > > static int iscsi_sw_tcp_slave_configure(struct scsi_device *sdev) > { > + struct iscsi_sw_tcp_host *tcp_sw_host = iscsi_host_priv(sdev->host); > + struct iscsi_session *session = tcp_sw_host->session; > + struct iscsi_conn *conn = session->leadconn; > + > + if (conn->datadgst_en) > + sdev->request_queue->backing_dev_info->capabilities |= BDI_CAP_STABLE_WRITES; > blk_queue_bounce_limit(sdev->request_queue, BLK_BOUNCE_ANY); > blk_queue_dma_alignment(sdev->request_queue, 0); > return 0; > -- Thanks for fixing this issue with data digests! Signed-off-by: Chris Leech