Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp576237ybz; Wed, 22 Apr 2020 04:03:39 -0700 (PDT) X-Google-Smtp-Source: APiQypIKEOyhoiYOTftSnUi5uppl2vpwSZM0UOVBo7K+oXMhWSq2gUvFSa+NngoQs8U9oz2ojzRR X-Received: by 2002:a17:906:4f03:: with SMTP id t3mr24789244eju.254.1587553419074; Wed, 22 Apr 2020 04:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587553419; cv=none; d=google.com; s=arc-20160816; b=uMnCX1YYtYoKesFiTJJkqy8WKNrq2lx1XrYmxzgmwVVh/6E/s74Mx/srDf1mg8MIel 7knIuBFD1Ft9k08dQHefGAUUnH54O2fueWuIIT1GIKA9jj2SGxEd6NgwGN6KNzBwjz/Z HGpkj8F9GM6jE5wNSJBCy3yPct/RhabtcQgrjRaAQKeKOUAdYpb+UJcFi0St5ZmVgYAk G6K67aBjyuRa38sjHGda2dbj/fYGEUA8DWkrkX/vrrqUU1NFzAcyfmybRwSxTM3TcMmc M+nZZkFueLNbqcjDjT0PmPVMjnjYVwvD0IRRCOYJFTdfUhyxS3B9OMDkulnANSLVsSs1 Un0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RAjMKVIWW6aQnkpsEt7FSKSn35DH+eOZx/WntnzR/Wc=; b=VUCkHorFzB4Ib3dvViSKKsfwa7ihWSllSZfWjEQfWPBYe26f3BY+rVMvIM0QlTsJxt vVO6nmYc0gfejxXXjCJvWnAoJWMw1Cddh/tZBbTV7q0rA8yo+n4kEBiFB0SdnH1hvq7x pEetZx0MNvV1YTTagxRldI75yWnAFHIiATfFqzV1t4IjOQtJRCVNddnQYRQPMmCTrmTs 9OECgUCV0u/9sN+I1nmt7Py+YxlwSa2RgTHZ3ffvCPMKCAGUqnp4+MqQESDdHKIbAUkq 50VQTSkMJgJGoA9mO9DSZOHYBGjbPrkvpxdf3JE3pRILHoJO0GYtQz89XjXz5YHUAjQK q6vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i+kh52Vh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 h23si3243559ejq.206.2020.04.22.04.03.08; Wed, 22 Apr 2020 04:03:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i+kh52Vh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726877AbgDVLBL (ORCPT + 99 others); Wed, 22 Apr 2020 07:01:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:50012 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726100AbgDVKBc (ORCPT ); Wed, 22 Apr 2020 06:01:32 -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 310C32077D; Wed, 22 Apr 2020 10:01:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587549691; bh=8H8u6hTqwGmn5z1Om6Z7kpMBmTSpROkiyjdq6uJkSnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i+kh52VhBWLQSCNZ1mkJ0yuaELo6zxllUm66JFlGpsbBXUZLRUXacB06CdL8HtLAd QbFHN+X32hxIkqtqxA8KdGK4mE11qSCiX2xkeX/HnsLSWzcDmpHSmLQhdQGVC3esQl 5ifP6hpNtz3OKEEAQmFCZANI8VXdK1mxpP0WBxpw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josh Triplett , Theodore Tso Subject: [PATCH 4.4 060/100] ext4: fix incorrect group count in ext4_fill_super error message Date: Wed, 22 Apr 2020 11:56:30 +0200 Message-Id: <20200422095033.905142426@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200422095022.476101261@linuxfoundation.org> References: <20200422095022.476101261@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 @@ -3791,9 +3791,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));