Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1263625ybt; Tue, 7 Jul 2020 11:17:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxV0mO55r/YT/g4WMqKH2NAQsmfmoWtedO1kgZuRGjsI7y3U+OYUy2KCHDblAPo1OtSgfeu X-Received: by 2002:a17:906:ce32:: with SMTP id sd18mr50056922ejb.228.1594145862847; Tue, 07 Jul 2020 11:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594145862; cv=none; d=google.com; s=arc-20160816; b=qryQLCEhfgQ+SzzoQCto9IlQuZ1d53E0OjcduEFb5sL03NZriG9wsqWvSHT4OfTmfh bZskuxlhMdRRHbwkHg7jmYpdgN8yDAsYL15LrkFj3zKEjCoYCK0tUiCODcZ0twf4/fvY Tk5FmKzu03T/LxX36ptiyTPBxPkbrlVQWNPdLOBKI8eatxAr6AX+/Mk1RSgGk4rPr4tq +OZCFBN6QJVmMffwNbJnLmafwtHplj1XoKwhK1vunkmWcLKpbweadJR8JircQ/pQPbDO udW9YG0YnCZtyOLQWzODpZY3DrJpDqssHmEMWXT676mX38jFDtZrBOoB0BwaZ8BBCNKE Azkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=9KMDaM1Duge+e8bPmJAUon8iKSg1AN7xooDjlzQHce4=; b=B9AOvfoahYeDkMQESn1SLPJ0UsMSKUgOTRjIsVKbibS7mjD4FdtZX4+WcAdTM7p8PN UeBdmWTJr+tKjNvNLDsZHzPGkK8HfNI5ewWh/86J7l5a7fotesRJLxuohF+KPDnIYOFu S9ZVBiiJNGjv4HaQ69Oih44AbElgsToGUgzLUnOVGoRPJrVlsjW/FtmIbmPAN9kx+lOF +8cv0gBiWBBKo7F4yBdrxSKFrtbuQW8nkRfOkDkpXYlpgOwju5jxuhI4TergqqMQNmIJ hzK2S/VkIpHXV3yM7BDb2QRjIbXko3eVLRc0Okd7IXGiPHgB5SMjuJJyKQrYDSm/6aYM Xh5g== ARC-Authentication-Results: i=1; mx.google.com; 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 ds3si18337153ejc.545.2020.07.07.11.17.19; Tue, 07 Jul 2020 11:17:42 -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; 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 S1728467AbgGGSQo (ORCPT + 99 others); Tue, 7 Jul 2020 14:16:44 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:46696 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728036AbgGGSQn (ORCPT ); Tue, 7 Jul 2020 14:16:43 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 07FA91C0C0F; Tue, 7 Jul 2020 20:16:42 +0200 (CEST) Date: Tue, 7 Jul 2020 20:16:41 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Anton Eidelman , Sagi Grimberg , Christoph Hellwig , Sasha Levin Subject: Re: [PATCH 4.19 10/36] nvme: fix possible deadlock when I/O is blocked Message-ID: <20200707181641.GA6290@amd> References: <20200707145749.130272978@linuxfoundation.org> <20200707145749.639245963@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HcAYCG3uE/tztfnV" Content-Disposition: inline In-Reply-To: <20200707145749.639245963@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --HcAYCG3uE/tztfnV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Sagi Grimberg >=20 > [ Upstream commit 3b4b19721ec652ad2c4fe51dfbe5124212b5f581 ] >=20 > Revert fab7772bfbcf ("nvme-multipath: revalidate nvme_ns_head gendisk > in nvme_validate_ns") >=20 > When adding a new namespace to the head disk (via nvme_mpath_set_live) > we will see partition scan which triggers I/O on the mpath device node. > This process will usually be triggered from the scan_work which holds > the scan_lock. If I/O blocks (if we got ana change currently have only > available paths but none are accessible) this can deadlock on the head > disk bd_mutex as both partition scan I/O takes it, and head disk revalida= tion > takes it to check for resize (also triggered from scan_work on a different > path). See trace [1]. >=20 > The mpath disk revalidation was originally added to detect online disk > size change, but this is no longer needed since commit cb224c3af4df > ("nvme: Convert to use set_capacity_revalidate_and_notify") which > already AFAICT cb224c3af4df is not applied to 4.19-stable series, so this is not safe according to the changelog. cb224c3af4df is simple enough, but AFAICT set_capacity_revalidate_and_notify() is missing in 4.19.132-rc1. Best regards, Pavel > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > index 0d60f2f8f3eec..5c9326777334f 100644 > --- a/drivers/nvme/host/core.c > +++ b/drivers/nvme/host/core.c > @@ -1602,7 +1602,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); > - revalidate_disk(ns->head->disk); > } > #endif > } --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --HcAYCG3uE/tztfnV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl8EvAkACgkQMOfwapXb+vJHhACfTcrMsI65LhKNa96+BH3NEXsp J80AoI0xlSa4NxGSIETKmktvgmbol1lY =TlK9 -----END PGP SIGNATURE----- --HcAYCG3uE/tztfnV--