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 BFFCEC77B7E for ; Sat, 29 Apr 2023 04:40:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230324AbjD2Eko (ORCPT ); Sat, 29 Apr 2023 00:40:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbjD2Ekn (ORCPT ); Sat, 29 Apr 2023 00:40:43 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FF4A30D2; Fri, 28 Apr 2023 21:40:42 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 9BE0268D13; Sat, 29 Apr 2023 06:40:38 +0200 (CEST) Date: Sat, 29 Apr 2023 06:40:38 +0200 From: Christoph Hellwig To: Ming Lei Cc: Theodore Ts'o , Baokun Li , Matthew Wilcox , linux-ext4@vger.kernel.org, Andreas Dilger , linux-block@vger.kernel.org, Andrew Morton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Dave Chinner , Eric Sandeen , Christoph Hellwig , Zhang Yi , yangerkun Subject: Re: [ext4 io hang] buffered write io hang in balance_dirty_pages Message-ID: <20230429044038.GA7561@lst.de> References: <663b10eb-4b61-c445-c07c-90c99f629c74@huawei.com> 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) Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sat, Apr 29, 2023 at 11:16:14AM +0800, Ming Lei wrote: > OK, looks both Dave and you have same suggestion, and IMO, it isn't hard to > add one interface for notifying FS, and it can be either one s_ops->shutdown() > or shutdown_filesystem(struct super_block *sb). It's not that simple. You need to be able to do that for any device used by a file system, not just s_bdev. This means it needs go into ops passed by the bdev owner, which is also needed to propagate this through stackable devices. I have some work on that, but the way how blkdev_get is called in the generic mount helpers is a such a mess that I've not been happy with the result yet. Let me see if spending extra time with it will allow me to come up with something that doesn't suck. > But the main job should be how this interface is implemented in FS/VFS side, > so it looks one more FS job, and block layer can call shutdown_filesystem() > from del_gendisk() simply. This needs to be called from blk_mark_disk_dead for drivers using that, and from del_gendisk only if GD_DEAD isn't set yet.