Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E720E335AC for ; Wed, 18 Oct 2023 12:10:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B157BA; Wed, 18 Oct 2023 05:10:07 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id C4F2267373; Wed, 18 Oct 2023 14:10:02 +0200 (CEST) Date: Wed, 18 Oct 2023 14:10:02 +0200 From: Christoph Hellwig To: Ming Lei Cc: Christoph Hellwig , Christian Brauner , Al Viro , Jens Axboe , Jan Kara , Denis Efremov , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 3/5] block: move bdev_mark_dead out of disk_check_media_change Message-ID: <20231018121002.GB9581@lst.de> References: <20231017184823.1383356-1-hch@lst.de> <20231017184823.1383356-4-hch@lst.de> <20231018064646.GA18710@lst.de> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Wed, Oct 18, 2023 at 05:15:36PM +0800, Ming Lei wrote: > > Yes. It has to be a non-exclusive open, though, and how is that going > > to help us with any general use case? If we really want to make the > > media change notifications any useful we'd better just do the work > > straight from the workqueue that polls for it. > > Given ->mark_dead() is added recently, userspace shouldn't depend on > this behavior, so this patch looks fine: While the method is new, disk_check_media_change called __invalidate_device before, which ended up both taking s_umount and thrashing the buffer cache under the fs.