Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp591859pxb; Tue, 15 Feb 2022 23:07:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTCJwDtLHz8vJx+AK3yNJTckq49jO6RwAsxf/5ZoyYD8UAp3V9ZDUBmA6whCoQ763ElKFO X-Received: by 2002:a63:2bc4:0:b0:34d:deaf:a091 with SMTP id r187-20020a632bc4000000b0034ddeafa091mr1153579pgr.125.1644995234411; Tue, 15 Feb 2022 23:07:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644995234; cv=none; d=google.com; s=arc-20160816; b=BM23wm7UsP00vzXO77m7gik7jy0Rladg5hq27BJpo3hoFGxYo0N26qdPlklxFqX9wc d9PxJ5TbhVqiO8qnD9nJFf4ZmroFXlbcKPYnZXbrFf9U3rI+ZvXt/grzai6ofJCY17v2 1InM5mk8+vmSt0Bnv1MAXMxAG5wNyLn50oUGe0NfaPoS3OvY2XIHXvDP784hiAWefSJD Bf2vxGWTpgKEFOZXdW5a3lzvuD0cb5bI4w2V/u3RlRcp43qTLC2z3PBZg0V6oWaXSwpg vmR2BD9E9Chey9h85OIxbjzAEn7kyVEFBZcxenzve64HMkV2avTrxFaPivQz4lPis7TH UYrA== 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=CmUfgVpQ36b0SdRPjDc0eK3YP+PsSOY6Op8d02v8SRM=; b=jI0BHv8G8EhYKn5K2a5bVE4mavtvokyPZ8U3np5GCxJyrWjf7xGsC36OUelC952Mbq s81zcKegWYju8MiY1BfW9g9NDuXPupqILBt69+uJkBOEuiZPX3j9leHGeLnHmAMvig/+ 85DRuHt5tYL10l3MFtMV5BF/skpUCw7jDPqPY0KpFPwRdyTLc4Ujsk8YQpUue6vYuOqb eSSAV7NgpI3exC+9qp70lNO32gMPkYW1idg/ZMBt3hsqGZhcxNyAgng3jKyeCr3ho1AA Pz3zYunAAc8s4K2cPWyRsFzG1oPB+U0P/Qj6nh9S46Ie0C8drMbzVovlY2zeUhyK8OfV DqjA== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b21si20255453pfv.177.2022.02.15.23.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 23:07:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4B060258630; Tue, 15 Feb 2022 22:44:23 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242724AbiBOURx (ORCPT + 99 others); Tue, 15 Feb 2022 15:17:53 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:41126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230355AbiBOURx (ORCPT ); Tue, 15 Feb 2022 15:17:53 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCBB8EB144; Tue, 15 Feb 2022 12:17:42 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id A045F68AA6; Tue, 15 Feb 2022 21:17:38 +0100 (CET) Date: Tue, 15 Feb 2022 21:17:38 +0100 From: Christoph Hellwig To: Markus =?iso-8859-1?Q?Bl=F6chl?= Cc: Keith Busch , 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: <20220215201738.GA26945@lst.de> References: <20220214095107.3t5en5a3tosaeoo6@ipetronik.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220214095107.3t5en5a3tosaeoo6@ipetronik.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 So, I think in th short run setting GD_DEAD is the right thing as a non-invasive fix, but I'd rather do it in blk_set_queue_dying to also cover the other drivers with a similar pattern. blk_set_queue_dying is never used for cases where q->disk isn't valid so that should be fine. In the long run I think we just need to remove the fsync_bdev in del_gendisk or at least make it conditional.