Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3129795ybi; Thu, 18 Jul 2019 21:36:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1rTEjG8fZgJ/ifUE9AivEa0tZs8GZo9/Y5maKqVHO5XIlub27ju2O/BdHTS9ti1rWpgcR X-Received: by 2002:a17:90a:35e5:: with SMTP id r92mr56224554pjb.34.1563510998938; Thu, 18 Jul 2019 21:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563510998; cv=none; d=google.com; s=arc-20160816; b=iGMAA3dQizZCYuvisAf7v4DZkDRTB+gFe+kMICaOA3atVAxkay9tiIUuwyT9YiyOu6 xOVe5Lw7KIJCnpB3ntw+LiI79oo20xj+zC/s5LqHMotCZmbP2GJKwKV82wpGp2ZJyBHZ MfYNsku8T4pLlcJdI1cFM8R9CJ28g6ZUaKyp0MQ+X9pGUIWdtCSfSBGL2c5ukWMAgyqX 04gc3s42qGd4hKNT7xF6KgibN/5IHWyePXpfRx1dkAfljhT293H8EA7HdI/iykGbjIrs oK0zdjW7W+8VNz6u2U6URBsLL71FkZhtbOSVOBbC7CktyQyA16yARQaavbSs0VBJrpDi h0rg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bf3tDGiPkdWGO6Xe6LFMGLo+sTu//zPXZKSPyoSgGVM=; b=FxGkNr1Sm11DtS4mdFqu+ivOp8mA3msr6Dg4OJIQV8AqqXqh6cL+N1wudV5TFisgfW 3sm0Qkfpj6VK5BHwPKFmLyDZB+ZfqjhF3vmZNkjt9BGvEDxut53UJ+lM2Xc9W0nqSOyt mh6LsWqxcElIKExHOQy6Zz2JbPwpBphi7fZsq0pXQ4SCprlLZlMTwNNVYrv8IX2fNnF2 oAzersY0omc7/vfHq3N1rUQxj1NlQy1oqCTBqnvV8EbOSwWzTU5KKjY3lVgI9WGxOYOk 3I+UPnSq/0a48ix0Fxp/2LBTHA/cvRs91EV87Iup+5BNv8/Eq+nRxcSid/Bz0OkeHDLF xLMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WJpuQHAJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w11si3682447pgk.384.2019.07.18.21.36.23; Thu, 18 Jul 2019 21:36: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=WJpuQHAJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730670AbfGSEfR (ORCPT + 99 others); Fri, 19 Jul 2019 00:35:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:33216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728552AbfGSEB3 (ORCPT ); Fri, 19 Jul 2019 00:01:29 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E88E92189F; Fri, 19 Jul 2019 04:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508888; bh=WnRs12+q0ocPyqCZ7djJyleRZcDXafyOhPyDCWFslTo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WJpuQHAJQPkPG5e4+hOGDIDvhYht1re4p1nSNn/alAGC3+PuB0X2lvxhTJzagqYJA WfpIkrVWnqYay1/ovHSS1vKmOhO6rv7o43fTeDylJx63YqCihlsvH1H7rlQj9wwoVd zZHH2tJ9PJmjnbre7bGm9Du2Y9XDzHGxOAoCMr+o= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mikhail Skorzhinskii , Mike Playle , Sagi Grimberg , Christoph Hellwig , Sasha Levin , linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 5.2 139/171] nvme-tcp: set the STABLE_WRITES flag when data digests are enabled Date: Thu, 18 Jul 2019 23:56:10 -0400 Message-Id: <20190719035643.14300-139-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mikhail Skorzhinskii [ 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 120fb593d1da..b4048748551e 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