Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1135990ybt; Tue, 7 Jul 2020 08:32:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyulMEN36rxKzrieNWQZWtjdxS/yzBH0dk97EUvjGAeuN0TCeDPreDwCFugp3B4Bfsf+kWL X-Received: by 2002:a05:6402:2d7:: with SMTP id b23mr49837315edx.145.1594135961625; Tue, 07 Jul 2020 08:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594135961; cv=none; d=google.com; s=arc-20160816; b=rAStX5K99E/GnPldkRSBHe3a8wJ3hIqB8mQpZeehK6LTJMT8ccta2LJ8d7mVQyMLud ny/2NpUacNjKyb+81Y7LanZOP//WoyZ09YVQAKxFkHVhxi5wd9SI47yH15LHHgJLDmmz kI2c1vAgqPBnXp2Axd5ZbF0k3BtiqoN5c0PemTOtkS+HlLq0uPPHl7+WbNMURUc+0/04 03BgaGgPmVL0tDn/Q1/2Vp5qSUbtyeJdvNpaBFzRRZf53du3jTU+HDQFIRZ4gmDZ2WuD kH3eNxSzsF/pqK21LUKlQLoV2XH5/TPH9JhYmVi6byrpuIi+HVCaoHRLxQfrmlhCbntk pvsw== 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=c3wJUe1uEJLAICBjKLCiwWJ12KLeNB+v/3bhUDmUeeA=; b=gTIfaFQ+k0SaVrSSzb6Gl/kiHhpEctZdfUO3Ufc7th+UIS/+SNk66jQuCZ1gurd+S7 dtAdGWKxRaA6wqO4pbZpw4dKHLsvWxBOOII8+8HGjS7PkdOHXeZz9y/fXusnldgm0YvI L9GiK/rrgUFwKiPI0XF9UBJWxI7Cn8iyrAaX4Qe76DfEEn4BNqGJVBkJijPDHxfL+Hdf iYd4KDmVzbQ8kTMRRv+J4XhzERRWVj8wblvjfhy/MrikR/VxAyYOW81vjD8B9o54Xr92 9v43mJz7FC/n0Ot6p7EC5ohG07jshxWE4nUIIqeNJM0jZLlxXcdOHXHWJN2DIuskgHCw ssTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ytVssuHw; 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 i23si15648905edx.261.2020.07.07.08.32.17; Tue, 07 Jul 2020 08:32:41 -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=ytVssuHw; 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 S1729234AbgGGPbJ (ORCPT + 99 others); Tue, 7 Jul 2020 11:31:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:36892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728758AbgGGPXk (ORCPT ); Tue, 7 Jul 2020 11:23:40 -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 A2CFB20771; Tue, 7 Jul 2020 15:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594135419; bh=QAD5qRIIxo3zrtd5no+WXBb73ggzwksH2e1jCZsJYOw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ytVssuHwcBD/I05/CCoib+lldBCrY1sOSGKzMYwGPYu+lpJk137ZzRyvjHMt67qp4 BFf/NEM2SUsPM4tlYSuOtQamxlN9kJJB8e8P2sAi9FN31oWjL+uux7XXPThAhpHNbT jbLayn+LRCSiizJdeuq7z51oCdpTfth7G5txReN4= 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.7 034/112] nvme-multipath: set bdi capabilities once Date: Tue, 7 Jul 2020 17:16:39 +0200 Message-Id: <20200707145802.611687480@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200707145800.925304888@linuxfoundation.org> References: <20200707145800.925304888@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/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 7b4cbe2c69541..887139f8fa53b 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1910,13 +1910,6 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id) if (ns->head->disk) { nvme_update_disk_info(ns->head->disk, ns, id); 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 17f172cf456ad..91a8b1ce5a3a2 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