Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp970372ybb; Sat, 28 Mar 2020 14:54:52 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv3gf74GvCBOsy0IX/4jvQ3QgGkYrfuZCJC64L0UlEud9RBqV+L0Mr+jVlGz7IDCIdDxK9S X-Received: by 2002:aca:ecd0:: with SMTP id k199mr3542878oih.60.1585432492735; Sat, 28 Mar 2020 14:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585432492; cv=none; d=google.com; s=arc-20160816; b=nXg+MQUeMmDDHrQUOqrTzJ/JbtXCzy7AXndNnsved8Dh0TzFB0Dtq4tAk9csmHnQy+ XpLBPBWW/z7JlnvRon6j22XE52RRg/y3pbs/GuGrj5W3SPEwY+CV59o0Nxqdxg8nxpiM kaJcOgvc8gq8elkeMXH7O1ur2N6uOSo7E4D+JjYuBeCLcbd3yT9hF083bBBdkMaCSLKH zQh3FbKj4hvoy3il8cyZEi5aSYrnt8BfgVGVAVuDY+WyzVggyENigrTxwPkhTeOsaWtR PuYmiBw+UTn1Tke90fej+5OwgLXi27cZr++uu2dYxzFhbev4efeYamPcc/T3qisnogUo sT4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=Y61x4vgwYrL+ofKxGED9sRG4BNQVQYJlbAkKBKme1Gc=; b=Qdijiv11Je7JK952cF7Mnnixl9j5LBYYGENbESO0kHHojtp19CvI9wAQL++8XoYmh5 ZFiEm3oUAuz9QMh5wqmszVlLi+QOxFfk/N9UESUk39MazCJJnmCSSXHgqLX3AWJMcwK3 Ddf+yCUY5dpSy7ZuS92qih4x4QSkSMSz7E+irTkbTq1gnUI/LJuTiXA7+CMdLRa1sQ4S lw9ZwiClb/Nzg1DOn/eB9Mrs2NZOasK50ShTm8m2k6CFvcFLItYYKDgSHqHah4zXeztO viT4tshbMFxNS45xSXnHUEFPtUzrkY3+QLRgS9JsWJ9v/f6I/L3qs5wOuM8mKWZePJpL PuBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10si4487892otk.128.2020.03.28.14.54.33; Sat, 28 Mar 2020 14:54:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727770AbgC1VyQ (ORCPT + 99 others); Sat, 28 Mar 2020 17:54:16 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:48987 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727716AbgC1VyQ (ORCPT ); Sat, 28 Mar 2020 17:54:16 -0400 X-Originating-IP: 50.39.173.182 Received: from localhost (50-39-173-182.bvtn.or.frontiernet.net [50.39.173.182]) (Authenticated sender: josh@joshtriplett.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id CD9A660004; Sat, 28 Mar 2020 21:54:11 +0000 (UTC) Date: Sat, 28 Mar 2020 14:54:01 -0700 From: Josh Triplett To: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Theodore Ts'o , Andreas Dilger Subject: [PATCH] ext4: Fix incorrect group count in ext4_fill_super error message Message-ID: <8b957cd1513fcc4550fe675c10bcce2175c33a49.1585431964.git.josh@joshtriplett.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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") --- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 0c7c4adb664e..7f5f37653a03 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4288,7 +4288,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) if (blocks_count > ((uint64_t)1<<32) - EXT4_DESC_PER_BLOCK(sb)) { ext4_msg(sb, KERN_WARNING, "groups count too large: %u " "(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)); -- 2.26.0