Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp3025029rwr; Fri, 28 Apr 2023 22:22:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5TViWic4GASLTgU+QV5EiZbbPBmdxUowfg7wjg1KYuMfR24777CgezjA0zlTM+wiTiARNr X-Received: by 2002:a05:6a00:139a:b0:63d:3278:9b11 with SMTP id t26-20020a056a00139a00b0063d32789b11mr12669498pfg.16.1682745760993; Fri, 28 Apr 2023 22:22:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682745760; cv=none; d=google.com; s=arc-20160816; b=Tnl1rh49/0BYENkCX2LvkTETcFZI1KxOCV/vJucx6XZa4C/crb8Xiajmbs+hQOpPK0 5L1sewylxgt5IzT8kcHpZ3wV30DTR6w0kQ9gAfAi4S5nJxjl4EFfGE7pz3oOjjs6u1H8 yPJX/r9XmPHWP0DyXPBM5/yKEgrcy4MlSWy32mbvBhauXu57JNouofc9MD+46fgyTyhn ODQ1TKOJiRWAiofB+Zubn8kkb7tE9qdDoAVSW4nwp5pBiFbVqGeGl3l/UsThO0sifazs mGVhqjEdb/DPmMS26T4OSdZP1bZAYYUfFRHLm6B1nBbyG6R84/CCDhZGKrX7jC+cgxMr MkqQ== 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=2hAEIix55mQqheQ/XmVIMx3hso9fuBFFY9y7DgUUBM8=; b=Sy9UvWQOd00/rgtT8jwZy/bM7TN0lSwCN96iTaIGtPTaehOojKh2Ap4g2iKxJA/rs3 3Z/KVoZSSEikRKUE3xw4C8G+pHWehU/5TlmUpr35E28efR4rLfFx0UxWWVACQoU/a8C+ rDprgjIwmkg/QSFvfYmrNx2vHRJbg6JhrdoRNRiRzUGd2ttNjYwvbD1fQibzX8ioQxRF lg017di1mHBaUWEv3+IPwspx1T5VxY+/tPLipJkM3MXYud2osc9qbAP/GeilabxDYiHH 2zzyfhlpA2Rat/UYmmuplh1mHpKlMfc9WoMJ62UhU65ffeBQzdASAXCafRJKNqVE4fMV 01Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Gk5p/caH"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i22-20020aa796f6000000b0063d2b810fc6si23239962pfq.305.2023.04.28.22.22.20; Fri, 28 Apr 2023 22:22:40 -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=@redhat.com header.s=mimecast20190719 header.b="Gk5p/caH"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230180AbjD2FL5 (ORCPT + 99 others); Sat, 29 Apr 2023 01:11:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjD2FL4 (ORCPT ); Sat, 29 Apr 2023 01:11:56 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 926962701 for ; Fri, 28 Apr 2023 22:11:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1682745067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2hAEIix55mQqheQ/XmVIMx3hso9fuBFFY9y7DgUUBM8=; b=Gk5p/caH9ff9TE4ldNADOIydHSmjf5IS2Jw14goLgpt/RVsm9KhEmG5GKcME0trRSDj4BM YdqYmgfo2d3Of2unhMir5EVA4Bx+CKAeC4pm291iQ7wu/Qq6j4Tk2zzjNFTQeM4jFhqqK8 5snjqAqEf+G7XsFqj4jne+JToGMDNtw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-352-R6yLz9NvNsCULUVy6I_V-g-1; Sat, 29 Apr 2023 01:11:04 -0400 X-MC-Unique: R6yLz9NvNsCULUVy6I_V-g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6741F85A5B1; Sat, 29 Apr 2023 05:11:02 +0000 (UTC) Received: from ovpn-8-24.pek2.redhat.com (ovpn-8-18.pek2.redhat.com [10.72.8.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6EE5400F4D; Sat, 29 Apr 2023 05:10:54 +0000 (UTC) Date: Sat, 29 Apr 2023 13:10:49 +0800 From: Ming Lei To: Christoph Hellwig 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 , Zhang Yi , yangerkun , ming.lei@redhat.com Subject: Re: [ext4 io hang] buffered write io hang in balance_dirty_pages Message-ID: References: <663b10eb-4b61-c445-c07c-90c99f629c74@huawei.com> <20230429044038.GA7561@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230429044038.GA7561@lst.de> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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 06:40:38AM +0200, Christoph Hellwig wrote: > 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. Not sure if it is needed for non s_bdev , because FS is over stackable device directly. Stackable device has its own logic for handling underlying disks dead or deleted, then decide if its own disk needs to be deleted, such as, it is fine for raid1 to work from user viewpoint if one underlying disk is deleted. > > 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. OK, looks you mean the API needs to be called before GD_DEAD is set, but I am wondering if it makes a difference, given device is already dead. Thanks, Ming