linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: linux-nvme@lists.infradead.org, hch@lst.de, sagi@grimberg.me
Cc: Keith Busch <kbusch@kernel.org>
Subject: [PATCH 06/10] nvme-multipath: set bdi capabilities once
Date: Thu,  9 Apr 2020 09:09:04 -0700	[thread overview]
Message-ID: <20200409160908.1889471-7-kbusch@kernel.org> (raw)
In-Reply-To: <20200409160908.1889471-1-kbusch@kernel.org>

The queues' backing device info capabilities don't change with each
namespace revalidation. Set it only when each path's request_queue
is initially added to a multipath queue.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 drivers/nvme/host/core.c      | 7 -------
 drivers/nvme/host/multipath.c | 8 ++++++++
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 7e5d28ed7b0c..2a27dcb7fac7 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1908,13 +1908,6 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
 #ifdef CONFIG_NVME_MULTIPATH
 	if (ns->head->disk) {
 		blk_queue_stack_limits(ns->head->disk->queue, ns->queue);
-		if (bdi_cap_stable_pages_required(ns->queue->backing_dev_info)) {
-			struct backing_dev_info *info =
-				ns->head->disk->queue->backing_dev_info;
-
-                        info->capabilities |= BDI_CAP_STABLE_WRITES;
-		}
-
 		revalidate_disk(ns->head->disk);
 	}
 #endif
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 54603bd3e02d..9f2844935fdf 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -3,6 +3,7 @@
  * Copyright (c) 2017-2018 Christoph Hellwig.
  */
 
+#include <linux/backing-dev.h>
 #include <linux/moduleparam.h>
 #include <trace/events/block.h>
 #include "nvme.h"
@@ -666,6 +667,13 @@ void nvme_mpath_add_disk(struct nvme_ns *ns, struct nvme_id_ns *id)
 		nvme_mpath_set_live(ns);
 		mutex_unlock(&ns->head->lock);
 	}
+
+	if (bdi_cap_stable_pages_required(ns->queue->backing_dev_info)) {
+		struct backing_dev_info *info =
+					ns->head->disk->queue->backing_dev_info;
+
+		info->capabilities |= BDI_CAP_STABLE_WRITES;
+	}
 }
 
 void nvme_mpath_remove_disk(struct nvme_ns_head *head)
-- 
2.24.1


_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2020-04-09 16:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09 16:08 [PATCH 00/10] namespace settings updates Keith Busch
2020-04-09 16:08 ` [PATCH 01/10] nvme: unlink head after removing last namespace Keith Busch
2020-04-10  7:12   ` Sagi Grimberg
2020-04-09 16:09 ` [PATCH 02/10] nvme: release namespace head reference on error Keith Busch
2020-04-10  7:13   ` Sagi Grimberg
2020-04-09 16:09 ` [PATCH 03/10] nvme: always search for namespace head Keith Busch
2020-04-10  7:31   ` Sagi Grimberg
2020-04-09 16:09 ` [PATCH 04/10] nvme: check namespace head shared property Keith Busch
2020-04-10  7:35   ` Sagi Grimberg
2020-04-09 16:09 ` [PATCH 05/10] nvme: don't directly update multipath queue settings Keith Busch
2020-04-10  7:45   ` Sagi Grimberg
2020-04-22 16:51     ` Keith Busch
2020-04-09 16:09 ` Keith Busch [this message]
2020-04-10  7:46   ` [PATCH 06/10] nvme-multipath: set bdi capabilities once Sagi Grimberg
2020-04-09 16:09 ` [PATCH 07/10] nvme: revalidate after verifying identifiers Keith Busch
2020-04-10  7:47   ` Sagi Grimberg
2020-04-09 16:09 ` [PATCH 08/10] nvme: consolidate chunk_sectors settings Keith Busch
2020-04-10  7:49   ` Sagi Grimberg
2020-04-09 16:09 ` [PATCH 09/10] nvme: revalidate namespace stream parameters Keith Busch
2020-04-10  7:50   ` Sagi Grimberg
2020-04-09 16:09 ` [PATCH 10/10] nvme: consolodate io settings Keith Busch
2020-04-22  7:56 ` [PATCH 00/10] namespace settings updates Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200409160908.1889471-7-kbusch@kernel.org \
    --to=kbusch@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).