From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFCE7C433FE for ; Tue, 15 Feb 2022 18:47:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243283AbiBOSrd (ORCPT ); Tue, 15 Feb 2022 13:47:33 -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) Precedence: bulk List-ID: X-Mailing-List: linux-block@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.