Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1515207rwr; Thu, 27 Apr 2023 20:10:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7P8WDtcwysShV5IJ5JWVlL/KuyjXo8o+GJL0H+w7swbWTNn5YXaHfwNIi4TJf9yP0Cqf2X X-Received: by 2002:a17:90a:8a85:b0:23f:81c0:eadd with SMTP id x5-20020a17090a8a8500b0023f81c0eaddmr4057449pjn.47.1682651408037; Thu, 27 Apr 2023 20:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682651408; cv=none; d=google.com; s=arc-20160816; b=QAUMseJah9ydn1YfZ1QVtxR4/WE/dK37xz8aO4VRkh1MSGnQN4eBbAurLW2p1Iqjkn RVAPuEJVkMizpg50x0qNEgN7q2/xmlp0fSTDfsEmz7VjdzDUg+jBEtEjOIHkfcoHJYuA vd530ryYgTz2PMkbWRZuyeQQPQOcQl5EVD2QN7FAgGPj1zhoQzMtNc74MyKWSCb2DDh5 h6cqTokx915Y+RLOEBsKk1hS0QsYb5qgzrEHZLxOZADLK9jPjbAr63HHiKqpWA+Nx5Nh D9c63LGcIEb9Op/6u7+1f509/qcLSmMDwFHrEwKI+hHM720C+13BhXWWOPKOY4NO9BAp LiqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mEdI3Z6CTreItykU8veCrx/99eYfpK8Gh6SV7amEBi0=; b=opOLI/UEPVOPAXXpu2eYhpzJtobM2FIBCtYLhqO0lPsDyEc/5Ga2J+d44oHL5e7tcT H6Ufgcb58GVMKg+SSz4baVib3vMJ1NRb2cNXv/yijE4W3w+GArdMb0zumm5aUO/I5bxT rHhQiuHGJpJNS3xyHa5hmXjBfe61g7jOwklPwZR21s8GVJlMavYUt9KtUfJsjG8hjVi9 xQbsPMwMNCUVS6ihg/JWBGO8E68/W4BwOXXHNpdlXUMC3T8nB6agmQNF7f8EapakHtBB LYD9NL1Wbm48XDLSDt3mNZgZ9uY08+Hs8OhYVCVG/h63r3XsXtDuSBcK89WV3x0bZUxj bzlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=seHWlYgd; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s17-20020a656911000000b00521075bf591si15516963pgq.534.2023.04.27.20.09.49; Thu, 27 Apr 2023 20:10:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=seHWlYgd; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229833AbjD1C4V (ORCPT + 99 others); Thu, 27 Apr 2023 22:56:21 -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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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-ext4@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