Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1127322ybt; Tue, 7 Jul 2020 08:21:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5qlrRRNp9+nPMIENb70Lvx/iM6uRvc3v3nl5jV/noO2YGAfRUOu9wG+K1u5svnKVZejmV X-Received: by 2002:aa7:c54e:: with SMTP id s14mr62631452edr.81.1594135319436; Tue, 07 Jul 2020 08:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594135319; cv=none; d=google.com; s=arc-20160816; b=TzQC1elhx3wOpPQKIbaOAuOle8BVdTAQsDj5soTrtkRQcI3/hPeHddAggkSnvVhtfp +Ic3s82ysHxwrEV1Q0rOxbFm+4ubKKB7LUX2bWqZHJK/+JTsqj0IwTZGFWmXdMGLrAdP db5YebK8D2MvF8YKYlH9JOPsyDxLGaUXwbAGNHcVNa5oNfeBXcEtHHq1JAgYYpZkrj/b RnhcC874WqL0rdOJVVFxOX1TH53ptWzzcOLRj6JMeiAwydnQEf6CM1wSbDv8Dn2tnlXY 9Ak3f9fufI01M5zQi6j0Jz1756Uu/th5B+e0KsNF8dt2FXM8hPuhlcICjFlHSfoMQ/Nv Ztqw== 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=5BuV3oBFjte7VoIy8tIOA8rMkqKvM/eYhLlo23aawf0=; b=mNMT/p0OHvxcCgLiWu1fAje8Sd6GZsvGpZO4hoQUjGdeX/PYW4v0JHgCnZhm/v6zZh BySS7pp7Wpgdrkqa7dPKur7rwjn81mEajbPaV26LG1mkri0TgraAkEhjKVePglZu1Njy jVzPxT61v1QJr3xVyQHDUPXsP5MYZOtzVaJ+SANkJ1woY27wEefXX4+EiFIVK4gSO8nj BS7vipNEk9Qeie/1uyC+2l0pILZ76q7TUJ9gNeuEG03e4OHGzITxUj+yl03E2r0lCe+b W2K4ExNYYBvozKVeykENdE+zpFYgxu00QNYkm2IyQXMMZ1a7GXAhE2CXVa5akeQq0NoB +NRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oXKgCvN3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m8si14972029ejq.294.2020.07.07.08.21.36; Tue, 07 Jul 2020 08:21:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oXKgCvN3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729474AbgGGPUH (ORCPT + 99 others); Tue, 7 Jul 2020 11:20:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:59864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729444AbgGGPUA (ORCPT ); Tue, 7 Jul 2020 11:20:00 -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 11CE4206F6; Tue, 7 Jul 2020 15:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594135199; bh=jIvBkcEF7WG9ja4SusRK6f3s7pPG/7g8KGvdI1OsHVw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oXKgCvN3YCo9B1u0Z32NqUzNmJ5iN3MbtZ1bmdE6eusSQ5HuoDZ/on5ttA9vNWqQw isxubuhIeMs81fPCUP64l8/GDjDLruCtMweBzNA7Efncq1wv9B389rueSDG9/+1LTA 2UZKXLaiMQb0/RPpymVlOJNJWr9Fikyf8oKWx778= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keith Busch , Sagi Grimberg , Christoph Hellwig , Jens Axboe , Sasha Levin Subject: [PATCH 5.4 13/65] nvme-multipath: set bdi capabilities once Date: Tue, 7 Jul 2020 17:16:52 +0200 Message-Id: <20200707145753.095915221@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200707145752.417212219@linuxfoundation.org> References: <20200707145752.417212219@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 From: Keith Busch [ Upstream commit b2ce4d90690bd29ce5b554e203cd03682dd59697 ] 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 Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/nvme/host/multipath.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c index 772eb05e57afe..7cc0ec180d555 100644 --- a/drivers/nvme/host/multipath.c +++ b/drivers/nvme/host/multipath.c @@ -3,6 +3,7 @@ * Copyright (c) 2017-2018 Christoph Hellwig. */ +#include #include #include #include "nvme.h" @@ -662,6 +663,13 @@ void nvme_mpath_add_disk(struct nvme_ns *ns, struct nvme_id_ns *id) ns->ana_state = NVME_ANA_OPTIMIZED; nvme_mpath_set_live(ns); } + + 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.25.1