Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp662667ybg; Wed, 10 Jun 2020 10:17:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNcS2VzCA3+bdL1QTRP1DHsroC/g0KAMinKqIrf/FUgB5QZSEXpHOIw0wO9FwRgF8yq+z5 X-Received: by 2002:a17:906:4c81:: with SMTP id q1mr4437354eju.273.1591809477719; Wed, 10 Jun 2020 10:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591809477; cv=none; d=google.com; s=arc-20160816; b=QZ5VNatiwBX61RSbGkeKiiYo+iQUYuUcm2XB5TjxdYpzHLO8ft0KIOQKPToaF9yuuK z/8adShcwckZUtCz+ssMxTd2pRj5ZQR4GJ0BMO30XbYK/XNyuu/4/4wbtFXlYRuVnb6D 5qUhzUbHaxI5SXa9GbAQYeaL9VI/x2lK1qdwEQJd2dJvRKZNzxodnuNMX+AV7UvCukqg nmod2wrKMognG+pZBH70EBXDD2PjeXxfBDAuBv6+JGC05W0zCXKIZdJY+Fuydb+sbVeY s3hgcmPMl5yTm2qUv45HoT4abH7XUi1NfHHrRMzVyMjr6yMwjB/zcm6dBqj16cpzmiXc t6Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=BxTTJsgpWUiv63tg4cNCEApoTpa6y8iwKfD+pOx64h0=; b=XBaH5oqUjg1e/5Vd2e8VesDoozZaMl07JdLjVyrSTAR4yW0AWvGJwMTbVynE0KwBxq IYCuTjKJ377Wz0ofrdzQx6HerwexUcJtOlM713enDHBdBmounmnrTYltNlJZ3k9ZDy1G EVfGdaZi62NNLovJqWcZiqfnxOn2CSUUE1JfAN4U3MheCvk9E9Q6CtGYWedhOUlYpcsu dH9pJmmy3QLPxKZtIzJzbDuORwt2DKZGqjZSLMvxIY8BtKC6L5nbISq2E8CAS7WQVyQ8 ZOhLGKgtL4qY+7faS3fJCaXXsbzL6HP8mB6Fp9T1I5wGok+Ytf0fe3LiVJTQV8fDKukT +qNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j24si338757ejy.277.2020.06.10.10.17.30; Wed, 10 Jun 2020 10:17:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728098AbgFJPqI (ORCPT + 99 others); Wed, 10 Jun 2020 11:46:08 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:56549 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728075AbgFJPqH (ORCPT ); Wed, 10 Jun 2020 11:46:07 -0400 Received: from callcc.thunk.org (pool-100-0-195-244.bstnma.fios.verizon.net [100.0.195.244]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 05AFjhUl030042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jun 2020 11:45:44 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 5489B4200DD; Wed, 10 Jun 2020 11:45:43 -0400 (EDT) Date: Wed, 10 Jun 2020 11:45:43 -0400 From: "Theodore Y. Ts'o" To: Jan Kara Cc: "zhangyi (F)" , linux-ext4@vger.kernel.org, adilger.kernel@dilger.ca, zhangxiaoxu5@huawei.com Subject: Re: [PATCH 00/10] ext4: fix inconsistency since reading old metadata from disk Message-ID: <20200610154543.GI1347934@mit.edu> References: <20200526071754.33819-1-yi.zhang@huawei.com> <20200608082007.GJ13248@quack2.suse.cz> <20200609121920.GB12551@quack2.suse.cz> <45796804-07f7-2f62-b8c5-db077950d882@huawei.com> <20200610095739.GE12551@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200610095739.GE12551@quack2.suse.cz> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Jun 10, 2020 at 11:57:39AM +0200, Jan Kara wrote: > > So I guess it may still lead to inconsistency. How about add this checking > > into ext4_journal_get_write_access() ? > > Yes, this also occured to me later. Adding the check to > ext4_journal_get_write_access() should be safer. There's another thing which we could do. One of the issues is that we allow buffered writeback for block devices once the change to the block has been committed. What if we add a change to block device writeback code and in fs/buffer.c so that optionally, the file system can specify a callback function can get called when an I/O error has been reflected back up from the block layer? It seems unfortunate that currently, we can immediately report the I/O error for buffered writes to *files*, but for metadata blocks, we would only be able to report the problem when we next try to modify it. Making changes to fs/buffer.c might be controversial, but I think it might be result in a better solution. - Ted