Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2999479rwr; Fri, 28 Apr 2023 21:43:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ71wVr5ZAVc16ZV0VF84AC57c+Pp3qaralxr7GbOiZioo9/YpxBTRiomQZGDKxjbWufxHOg X-Received: by 2002:a17:90b:360f:b0:24b:da56:84fb with SMTP id ml15-20020a17090b360f00b0024bda5684fbmr7475455pjb.37.1682743428188; Fri, 28 Apr 2023 21:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682743428; cv=none; d=google.com; s=arc-20160816; b=P23MjSmsoiCacNTE4PFXTozVHmbJ4YMaF+5bRb103g9uESBnGbmDj39RS2ZU9l7/Cr D5EQwHLz8EN8QC9kcvoV/2/f7KXNIvR5v5p0zPQ146VWXzyHJVoczdTA3doLtQ0Qhtt7 7wgNidJgupx4qKkY6LQ1XLVsja00WMi1FpPRe4JpjW0GoVVjHJFkNXAlv36dqmSO9mzl aWiBne038SNeAVYhtdrp3GztDV+KQmhFY0OQIh3RRi5pE/5Td2T1OGXnXBKKDLjK7SMf hqOUeantuzbcM9+6DO4X3HhLMLIhv02OWyLJZQEfULbG++tvkWYiJAifijo6oXIm/7tT S81g== 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=LZED551cPg/Me3kYmpD1y1Iqb6yZqgG1tIvc3018i8U=; b=iCMlVfglIYYIeK6/rWK/4zbXwGa2RGpcL7Ssz2eonNPaH2U0IsBgQR1WTRm4jpGwBK aP1StvPfOGGwvcYuPXCbTj2Y5NkLoUoQ+3Gd4s12yb3aFwApOehrqciXlbYPTIb1DC3X f/FcI6GKje/aq2bx5SABmLJAtqjuE1AvTUuxPhEX8DalwEcR5fmdFM/pEuYf3jZ4o5eC MzpsZIlSRyR5Y+KDFaXegEZdTvlR5CdhEFYPz1eUAhGcFS3fmQHErK0pNVBSgOmWFfWh h+Y5CGm/COts7goCxh4nK8Z+xuJRdhuIRoqfauotbMMNgIfGiY47KRZIcsNAaI4/b27/ t4qQ== ARC-Authentication-Results: i=1; mx.google.com; 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 q3-20020a63e943000000b0051f663b7e8esi23850177pgj.51.2023.04.28.21.43.28; Fri, 28 Apr 2023 21:43:48 -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; 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 S230104AbjD2Eko (ORCPT + 99 others); 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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE 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 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.