From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 7BAE1C0044D for ; Mon, 16 Mar 2020 09:30:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5243E20658 for ; Mon, 16 Mar 2020 09:30:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730287AbgCPJau (ORCPT ); Mon, 16 Mar 2020 05:30:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:35140 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730025AbgCPJat (ORCPT ); Mon, 16 Mar 2020 05:30:49 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C7462AD2A; Mon, 16 Mar 2020 09:30:48 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 8836F1E10DA; Mon, 16 Mar 2020 10:30:48 +0100 (CET) Date: Mon, 16 Mar 2020 10:30:48 +0100 From: Jan Kara To: "Theodore Y. Ts'o" Cc: Jan Kara , linux-ext4@vger.kernel.org Subject: Re: [PATCH 2/7] e2fsck: Fix indexed dir rehash failure with metadata_csum enabled Message-ID: <20200316093048.GD12783@quack2.suse.cz> References: <20200213101602.29096-1-jack@suse.cz> <20200213101602.29096-3-jack@suse.cz> <20200307231719.GE99899@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200307231719.GE99899@mit.edu> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat 07-03-20 18:17:19, Theodore Y. Ts'o wrote: > On Thu, Feb 13, 2020 at 11:15:57AM +0100, Jan Kara wrote: > > E2fsck directory rehashing code can fail with ENOSPC due to a bug in > > ext2fs_htree_intnode_maxrecs() which fails to take metadata checksum > > into account and thus e.g. e2fsck can decide to create 1 indirect level > > of index tree when two are actually needed. Fix the logic to account for > > metadata checksum. > > > > Signed-off-by: Jan Kara > > Applied with a minor change; I didn't want to make this change: > > > -_INLINE_ int ext2fs_htree_intnode_maxrecs(ext2_filsys fs, int blocks) > > +static inline int ext2fs_htree_intnode_maxrecs(ext2_filsys fs, int blocks) > > ... because it would make ext2fs_htree_intmode_maxrecs disappear from > libext2fs.so. Aha! I was wondering what's going on with those strange inline statements... > So I changed this: > > > + if (ext2fs_has_feature_metadata_csum(fs->super)) > > to this: > > + if ((EXT2_SB(fs->super)->s_feature_ro_compat & > + EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) != 0) > > to fix the inline related compilation errors. Thanks for fixing this! Honza -- Jan Kara SUSE Labs, CR