Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2426858pxa; Fri, 7 Aug 2020 10:50:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwa3iL42R0I7Zei+ngwswDmMBm7oK33QntIYaHTaSzt9ctRfRvf5GCHxAh3JeN6VkhCHwtN X-Received: by 2002:a17:906:ae12:: with SMTP id le18mr10376302ejb.38.1596822631709; Fri, 07 Aug 2020 10:50:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596822631; cv=none; d=google.com; s=arc-20160816; b=YnJ56xZXUM9sqtQAVxhKNELtnKAzsRq0HAqZvrGRsspYyLEf2NpQxzyUZ5xm0p2XgP 9IhpZ0z9yGa28biCAcz4H+o2KmUL9S2Y31Mfs71z19sDw87kLZzw7vqrp4JvDrgh9usT at4ndLIcTeElmVL8UcEJes+dn08Zcpv5qXX/G2XNxHpDISw7Phuvcp5gvAdjp7UiujgX CegoOiytTNLH/oXfdCL7iwyrFbYbjowXu9tNmgKjqeaWa0X2eSbgbXWf4U/1CFW540eb HVXp13FFkd3PexEL+X+cKiTqcr3t+ukbCY50WCmak9TfLToz5SXF+/qI9KSvg2SdSK6E 3xCg== 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=WtRMNy9Sp+FgdOBxNunuF55ImTtK094pqOrqIKBXxg0=; b=OVAE/joWIaxszqt6AU2xEw90rGaA3N15UR7efCurhLnrK9BWcwSq3AWof/08y29+0a xihBwO5A9H5pK3ZmmV9z4u2RMkLmW7Li+v3u+/0jrs6nSlP8xF0nykS49LfvrZ/ZAKbH bDxwtVnrLrstiSW1JuE7TUDjgxjyKMP6lEk3yGlBlb68rnmWO6n23hipMA8V9/872b5x hRxlUC3iGrMVLgqHI5BiJ7t89N8Fx2B+xObzcZXQYlLdyzV56U1Rp/TNvZc+UllbQcgF 8V1D+YO9aPwWFDlrIjPlE13E4namjqot8nBjUx0fHoNZE1NLaSCZNy6rvRNUzQG3gjao NEmw== 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 d12si3953379ejj.168.2020.08.07.10.50.01; Fri, 07 Aug 2020 10:50:31 -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 S1728067AbgHGRt4 (ORCPT + 99 others); Fri, 7 Aug 2020 13:49:56 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:37728 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726038AbgHGRt4 (ORCPT ); Fri, 7 Aug 2020 13:49:56 -0400 Received: from callcc.thunk.org (pool-96-230-252-158.bstnma.fios.verizon.net [96.230.252.158]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 077HnP53001823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 7 Aug 2020 13:49:25 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id 2D34B420263; Fri, 7 Aug 2020 13:49:25 -0400 (EDT) Date: Fri, 7 Aug 2020 13:49:25 -0400 From: tytso@mit.edu To: "zhangyi (F)" Cc: , , , , Subject: Re: [PATCH v3 1/5] ext4: abort the filesystem if failed to async write metadata buffer Message-ID: <20200807174925.GV7657@mit.edu> References: <20200620025427.1756360-1-yi.zhang@huawei.com> <20200620025427.1756360-2-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200620025427.1756360-2-yi.zhang@huawei.com> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat, Jun 20, 2020 at 10:54:23AM +0800, zhangyi (F) wrote: > There is a risk of filesystem inconsistency if we failed to async write > back metadata buffer in the background. Because of current buffer's end > io procedure is handled by end_buffer_async_write() in the block layer, > and it only clear the buffer's uptodate flag and mark the write_io_error > flag, so ext4 cannot detect such failure immediately. In most cases of > getting metadata buffer (e.g. ext4_read_inode_bitmap()), although the > buffer's data is actually uptodate, it may still read data from disk > because the buffer's uptodate flag has been cleared. Finally, it may > lead to on-disk filesystem inconsistency if reading old data from the > disk successfully and write them out again. > > This patch detect bdev mapping->wb_err when getting journal's write > access and mark the filesystem error if bdev's mapping->wb_err was > increased, this could prevent further writing and potential > inconsistency. > > Signed-off-by: zhangyi (F) > Suggested-by: Jan Kara Thanks, applied. - Ted