Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CF8BC433DB for ; Wed, 17 Mar 2021 17:13:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D650864E61 for ; Wed, 17 Mar 2021 17:13:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230171AbhCQRNR (ORCPT ); Wed, 17 Mar 2021 13:13:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:44390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231186AbhCQRNC (ORCPT ); Wed, 17 Mar 2021 13:13:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 291FC64E61; Wed, 17 Mar 2021 17:13:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616001181; bh=Yy8+rIl8hJOPF5TcVWrRHzlF76+dwyLxuLeM0ZJyIhE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BuOLD1GaPpobOy17d1RyPBBneqsNYqBj77CIJh64IYaTPc1jqM9U8vXBX8CX+aTKG 4WA0hcHp0mFBapSStOkczlE0gUC6QZFnhsXIxzV08yYTnvIm9pduZ/RePFUeTGLdXP isgnhBtQVsp385J8fryAIdEwT/Es2Jg6tdVgRwXU= Date: Wed, 17 Mar 2021 18:12:59 +0100 From: Greg Kroah-Hartman To: Jan Kara Cc: stable@vger.kernel.org, Wolfgang Frisch , Lukas Czerner , Theodore Ts'o Subject: Re: [PATCH stable 4.19.y] ext4: check journal inode extents more carefully Message-ID: References: <20210317162331.16712-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210317162331.16712-1-jack@suse.cz> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Wed, Mar 17, 2021 at 05:23:31PM +0100, Jan Kara wrote: > [Upstream commit ce9f24cccdc019229b70a5c15e2b09ad9c0ab5d1] > > Currently, system zones just track ranges of block, that are "important" > fs metadata (bitmaps, group descriptors, journal blocks, etc.). This > however complicates how extent tree (or indirect blocks) can be checked > for inodes that actually track such metadata - currently the journal > inode but arguably we should be treating quota files or resize inode > similarly. We cannot run __ext4_ext_check() on such metadata inodes when > loading their extents as that would immediately trigger the validity > checks and so we just hack around that and special-case the journal > inode. This however leads to a situation that a journal inode which has > extent tree of depth at least one can have invalid extent tree that gets > unnoticed until ext4_cache_extents() crashes. > > To overcome this limitation, track inode number each system zone belongs > to (0 is used for zones not belonging to any inode). We can then verify > inode number matches the expected one when verifying extent tree and > thus avoid the false errors. With this there's no need to to > special-case journal inode during extent tree checking anymore so remove > it. > > Fixes: 0a944e8a6c66 ("ext4: don't perform block validity checks on the journal inode") > Reported-by: Wolfgang Frisch > Reviewed-by: Lukas Czerner > Signed-off-by: Jan Kara > Link: https://lore.kernel.org/r/20200728130437.7804-4-jack@suse.cz > Signed-off-by: Theodore Ts'o Now queued up, thanks! greg k-h