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=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 43017C3A5A0 for ; Mon, 20 Apr 2020 12:59:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1F5FC20735 for ; Mon, 20 Apr 2020 12:59:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587387593; bh=7s/A5hB/WqsWQ7FK9LN4e5tX6UbcmxnCAt7FXh9RG5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ckS2lwWzoM3n2O4tY29tbVrvEBdU50mGx9eHy0z2vIt7GkRkRVBL1EjxycynchNFb A0R/Wp8zxVyosZyzvz9SeP00pJbsngidbt65vOaF7Trr8/Kw3WqVAIUZ48j/mB6UAL uTsTKaPZV9jkOyqhgsfzeAZrMYwSut1fBMVO+88U= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727919AbgDTMlE (ORCPT ); Mon, 20 Apr 2020 08:41:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:33486 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727900AbgDTMlA (ORCPT ); Mon, 20 Apr 2020 08:41:00 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 27C692070B; Mon, 20 Apr 2020 12:40:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587386459; bh=7s/A5hB/WqsWQ7FK9LN4e5tX6UbcmxnCAt7FXh9RG5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b0bwdGr4xkE2AcrqtJZe6ZW5B1OBMXwDSa4QAJbayJ1BgvfBSn01e+NrRnNHvmjJA AyBDQAHAfYedHMNR+R7X89AwaGkieltAZL6NdBG2VZauAT64IvB+dMLSu9hVRyTSqh ScemR3rHee1bejBwLj/LlJD2lN7LAtmh/xWobUiQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josh Triplett , Theodore Tso Subject: [PATCH 5.5 30/65] ext4: fix incorrect group count in ext4_fill_super error message Date: Mon, 20 Apr 2020 14:38:34 +0200 Message-Id: <20200420121512.738810587@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200420121505.909671922@linuxfoundation.org> References: <20200420121505.909671922@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josh Triplett commit df41460a21b06a76437af040d90ccee03888e8e5 upstream. ext4_fill_super doublechecks the number of groups before mounting; if that check fails, the resulting error message prints the group count from the ext4_sb_info sbi, which hasn't been set yet. Print the freshly computed group count instead (which at that point has just been computed in "blocks_count"). Signed-off-by: Josh Triplett Fixes: 4ec1102813798 ("ext4: Add sanity checks for the superblock before mounting the filesystem") Link: https://lore.kernel.org/r/8b957cd1513fcc4550fe675c10bcce2175c33a49.1585431964.git.josh@joshtriplett.org Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4241,9 +4241,9 @@ static int ext4_fill_super(struct super_ EXT4_BLOCKS_PER_GROUP(sb) - 1); do_div(blocks_count, EXT4_BLOCKS_PER_GROUP(sb)); if (blocks_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) { - ext4_msg(sb, KERN_WARNING, "groups count too large: %u " + ext4_msg(sb, KERN_WARNING, "groups count too large: %llu " "(block count %llu, first data block %u, " - "blocks per group %lu)", sbi->s_groups_count, + "blocks per group %lu)", blocks_count, ext4_blocks_count(es), le32_to_cpu(es->s_first_data_block), EXT4_BLOCKS_PER_GROUP(sb));