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 5C9D6C77B61 for ; Fri, 28 Apr 2023 02:56:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344808AbjD1C4W (ORCPT ); Thu, 27 Apr 2023 22:56:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjD1C4U (ORCPT ); Thu, 27 Apr 2023 22:56:20 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87F8C273B; Thu, 27 Apr 2023 19:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mEdI3Z6CTreItykU8veCrx/99eYfpK8Gh6SV7amEBi0=; b=seHWlYgdjaUbCRl6TG4VMh99ch ec4Fp45TlwMoxnqctUCZKm7uqeycSIrPUi5fz5wUZ31MHTYGMGR7f2xsaEknDSsz9hyTFOl0WfLog B3VCyrkETgv3yDQtGBTBMKEJi5JdJhiGx7qrFRvTyI713pGaXWUGi/v4tBBuJdTMaJr4uL75bRDsE MRC0tgp0I8cwg5AQrfy0yDVG6E1oJcOJJjDJ1PT8TF6+CTvCgxqv/8OXhgifrnP2jHbqnAmQvQUjy zpmbKaSPq6pDZtbMCwmeGBgJLvnEpCRab+pCkONDrx7ORrNZgJ1WCdZfCRBt8ieIRhfWSqwFaoGpk wV4sSxqw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1psEHN-004Br5-Mi; Fri, 28 Apr 2023 02:56:13 +0000 Date: Fri, 28 Apr 2023 03:56:13 +0100 From: Matthew Wilcox To: Dave Chinner Cc: Ming Lei , Theodore Ts'o , linux-ext4@vger.kernel.org, Andreas Dilger , linux-block@vger.kernel.org, Andrew Morton , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Eric Sandeen , Christoph Hellwig , Zhang Yi Subject: Re: [ext4 io hang] buffered write io hang in balance_dirty_pages Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Apr 28, 2023 at 09:33:20AM +1000, Dave Chinner wrote: > The block device needs to be shutting down the filesystem when it > has some sort of fatal, unrecoverable error like this (e.g. hot > unplug). We have the XFS_IOC_GOINGDOWN ioctl for telling the > filesystem it can't function anymore. This ioctl > (_IOR('X',125,__u32)) has also been replicated into ext4, f2fs and > CIFS and it gets exercised heavily by fstests. Hence this isn't XFS > specific functionality, nor is it untested functionality. > > The ioctl should be lifted to the VFS as FS_IOC_SHUTDOWN and a > super_operations method added to trigger a filesystem shutdown. > That way the block device removal code could simply call > sb->s_ops->shutdown(sb, REASON) if it exists rather than > sync_filesystem(sb) if there's a superblock associated with the > block device. Then all these I think this is the wrong approach. Not that I've had any time to work on my alternative approach: https://www.infradead.org/~willy/banbury.html