Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3801433ybi; Mon, 29 Jul 2019 12:54:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhCH1ETArltXV2lp2PyTbPgCC6DgvQBRZ+VArabPpG8JKZBJB51RzPopiQaO47+l6l3jKr X-Received: by 2002:a63:60c1:: with SMTP id u184mr101823140pgb.275.1564430078555; Mon, 29 Jul 2019 12:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564430078; cv=none; d=google.com; s=arc-20160816; b=lGYa/xHqQxJ7Zgjsm27oSJtQTCDUiCTAX6/ZodMoxJDMWvofLl/Ip3+oz07PJKg1pR rHzjDhqmsVmswtShsox+lSU5RPiGjhydE5hmYn7SsTu3oGl/+pqBkGzlbFgaXZJzTsEp qoHxoFVe1Do5MhRfoFeqJHg8Jk4KMywqnVsX1X0+wK+0hFVPeRZjh3jLk0YnnC37hVAe +es9QZCzf+bzSCZuZEnOwHYr2uHkvPTQkgaiX7OzmES2S/dNFbXm0AhGSKQw6wU7mxSB W4gKHVRlCggVeIObACkVBO19epcHF0jcjYTEg0ZP9S6nhx3Sd1XJbpi6JGE7qhpvzfWV PBhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9/OSGhjuYtJDxxo867b6f/z7hh2Caecld0xle27h7VU=; b=JCSDXqmcdOw93LCYA7Ujgi8uQuosVK3rPLhf89ycNiO8AKhTop7eXq8XuCsyCfv5ou XWTrSj/dss1XvkMmvjFFByHxBNET/syjA3WvYMQ1Mx4fFrL1IwbCGfgMJXMb67vapMdw 3EGT7w3qqMj/FYTttZwLXeh5jvzRQOmkh6kSdNxos0MW9TuEKeII2Em6kRhz5qeT/6dB aEltkwrIqP/z61iJvofH+eS3xbxsOHs9wMaT9x/kBs/UiGsaLgNGCSvna2vjecIjqBdH PK9BvefyuF2iHFTcYnFEqaP6pwwi7S8Y0eCgaSFeFy5ifDRSRSZQwboOiHxP9T+08xlV T9tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q+YPzzJe; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7si28980288pfp.4.2019.07.29.12.54.23; Mon, 29 Jul 2019 12:54:38 -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; dkim=pass header.i=@kernel.org header.s=default header.b=q+YPzzJe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403904AbfG2Tv5 (ORCPT + 99 others); Mon, 29 Jul 2019 15:51:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:43570 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390222AbfG2Tvy (ORCPT ); Mon, 29 Jul 2019 15:51:54 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 682F3217D4; Mon, 29 Jul 2019 19:51:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429913; bh=kWYMEl2mcLtwN/DWe0hT2YGnrHiImohYSWe2qTLe4J8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+YPzzJeeyUKqVMCCfQkGJNKWFbwnN4ooN6+D7Sqgk59QEjg5EFaJ1z/eFaH+nY9X ULqZphlk0SG4G+8qIR0nrVsV0VZHLo6/CdI5U7txpRXevE8m5ejTbNiW5MUjnMSpO+ 4r8/hgFIIWcPt76ySBiXypPm42lzurlgmU300lyw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mikhail Skorzhinskii , Mike Playle , Sagi Grimberg , Christoph Hellwig , Sasha Levin Subject: [PATCH 5.2 136/215] nvme-tcp: set the STABLE_WRITES flag when data digests are enabled Date: Mon, 29 Jul 2019 21:22:12 +0200 Message-Id: <20190729190803.152828213@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 958f2a0f8121ae36a5cbff383ab94fadf1fba5eb ] There was a few false alarms sighted on target side about wrong data digest while performing high throughput load to XFS filesystem shared through NVMoF TCP. This flag tells the rest of the kernel to ensure that the data buffer does not change while the write is in flight. It incurs a performance penalty, so only enable it when it is actually needed, i.e. when we are calculating data digests. Although even with this change in place, ext2 users can steel experience false positives, as ext2 is not respecting this flag. This may be apply to vfat as well. Signed-off-by: Mikhail Skorzhinskii Signed-off-by: Mike Playle Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Sasha Levin --- drivers/nvme/host/core.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 22c68e3b71d5..215bef904b7b 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -3256,6 +3257,10 @@ static int nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) goto out_free_ns; } + if (ctrl->opts->data_digest) + ns->queue->backing_dev_info->capabilities + |= BDI_CAP_STABLE_WRITES; + blk_queue_flag_set(QUEUE_FLAG_NONROT, ns->queue); if (ctrl->ops->flags & NVME_F_PCI_P2PDMA) blk_queue_flag_set(QUEUE_FLAG_PCI_P2PDMA, ns->queue); -- 2.20.1