Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp211521pxb; Tue, 15 Feb 2022 11:35:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJy56waBB5wwwrSiAszqYCqWeVauYOHGTaU1A9mnxKO8qahVubqbPVobVr/Ep63M2k8q0sAy X-Received: by 2002:a63:1c0e:: with SMTP id c14mr351885pgc.211.1644953728605; Tue, 15 Feb 2022 11:35:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644953728; cv=none; d=google.com; s=arc-20160816; b=eQ5oppWqGdzWlCEjH8pzPMnKXjnRANxc0ekvqdP2AO1KNE8jzfS0vFiP19eorLSPKl QaBi9fq+U4fD34DOxh5L6NhqEw3WHO8yBDX9Xp3Yrq/FU/CV/Od1VCc0jZ49iiBYpJId yaaGQpWn2EyWElNqFiUguxp9OAuWJvZ6LkIiUSuiMlwSRcQDHEn4sqM1DV5YfIm0ugCP VIXnJcUOjJOFoimYHkSf4/1jUGBLZkWVLj/wuJhKC0fvkuPmJhrSSfCthQkWwahUxfYb eszsSEiqZaiWpt5Wa5K7Xn32+sBoyrfuXUjUxUCyKp8FXry6cEthtqA/aB6YlXwgNNGs AJvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fNXXSrPoGPJEDjqcbNsdzREIzKgOpDhpYBDle/OA5bY=; b=F/WaLwGaM/z1pvaegp5B8QmFZz5Sc3jCVw6S1u+Y3lAEVMVN7oQiUDnubeBGXxkyE/ zG5R+uIUZU1iJyTVgIE6+JGhbI68x4TsjmOGefvJ971GKx+axtw2TuMToH/Th4prFWzO MbYg7YJ2FQXNvoJyBLhionOCtMDSeXg4XH1NrGNhK8/pNaTA10ZsO/sTm2OHpot2qhla rTCYhWbp+rEJ68KLz6sIB+vy8WG7SdBh/KOhzcN3r6AtdtYBkb2DO/D2QdTuXBYOVYhi ZfijqbhQJ2SVxddCFWtBBq5Ld5p2HvcqDf6lIvsBNxHfCTRbKyJS2vHs/pO7Z6ZPtGx5 PL8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y22si16086689pll.259.2022.02.15.11.35.12; Tue, 15 Feb 2022 11:35:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243289AbiBOSrh (ORCPT + 99 others); Tue, 15 Feb 2022 13:47:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:58934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243286AbiBOSrb (ORCPT ); Tue, 15 Feb 2022 13:47:31 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F9113B031; Tue, 15 Feb 2022 10:47:08 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 7931068AA6; Tue, 15 Feb 2022 19:47:04 +0100 (CET) Date: Tue, 15 Feb 2022 19:47:04 +0100 From: Christoph Hellwig To: Keith Busch Cc: Markus =?iso-8859-1?Q?Bl=F6chl?= , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Roese Subject: Re: [RFC PATCH] nvme: prevent hang on surprise removal of NVMe disk Message-ID: <20220215184704.GB24543@lst.de> References: <20220214095107.3t5en5a3tosaeoo6@ipetronik.com> <20220215152240.GB1663897@dhcp-10-100-145-180.wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220215152240.GB1663897@dhcp-10-100-145-180.wdc.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 15, 2022 at 07:22:40AM -0800, Keith Busch wrote: > I can't actually tell if not checking the DYING flag check was > intentional or not, since the comments in blk_queue_start_drain() say > otherwise. > > Christoph, do you know the intention here? Should __bio_queue_enter() > check the queue DYING flag, or do you prefer drivers explicity set the > disk state like this? It looks to me the queue flags should be checked > since that's already tied to the freeze wait_queue_head_t. It was intentional but maybe not fully thought out. Do you remember why we're doing the manual setting of the dying flag instead of just calling del_gendisk early on in nvme? Because calling del_gendisk is supposed to be all that a tree needs to do.