Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1041633ybb; Sat, 28 Mar 2020 16:56:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvK47/FJzItNtHQGtNjXpQ3ja45crRZh+xQoeWAJZYrUSL+zjpbJLh+nxTR13VBacYmjO1r X-Received: by 2002:a05:6830:1313:: with SMTP id p19mr4399754otq.179.1585439804849; Sat, 28 Mar 2020 16:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585439804; cv=none; d=google.com; s=arc-20160816; b=MhyCJ4ZelelDbDdLVQpnFcYu/YC7cEDDw0R1ARWjK+NVYsaOTdQ2UCUZgYQ561jaeh F9TudPinmtvVrbgsa8Den69ijS9WmqMh9yojCgCzhCq5dumqMYeUuhTqbPt+pVSFnz5Y w38Ywm3aEyNhXldgZ+YvP1dyvM0GcrFQFz4GNSXtSTACYQmUzcre7LMwE/b9NvdZrgpG eeN7gdENL18Bji+vt6P/0yeiVMdSnLRmwWXNULnKS7T+A144m0pDgx3ymRohe84PQGG8 K5YbSI5fmze/xJ8MtO8VqX+x8Cl6L86WemaPs/3Bj4MvGscSiXRKhgy/TGUBJNCLBd7A vWVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=el/P9EBqyHXp13ECRIbNtb2G42+fWgrF2fcd01HDXsA=; b=A9vfhw/VfOFkwWKhkI92LIwBlS03753TmIgiB1yPqtN5QonteTWbUJOGuhTDrUJavL m5AazmvdnWd0HdwiKp3MDfKr3OXnseMjWI9Q9Xz/WH3f6aIvJyG1ccULDsBVqShteX8O lU/4m5+hD21x/aW6lEvB2m4Q9G5ry2O1UnV3LRsHr5G0RML1kUNjIfRgFVV3NfzB/pKi H8rTvxxPi5bKbm5hHhuUm6/U13JrcQ+7p2nelw2FD+CmFoJl1MU6TmIffs2duKMS4Vej iC9FYDjGDEBbqEXs6ntnKqWHMrJVBaRXE5g5bLpFvFUNApHRtv9ekYlHR+bJdwSo1n2r gtdQ== 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 h1si3994591otr.127.2020.03.28.16.56.28; Sat, 28 Mar 2020 16:56:44 -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 S1727620AbgC1X4B (ORCPT + 99 others); Sat, 28 Mar 2020 19:56:01 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:35987 "EHLO relay8-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726604AbgC1X4B (ORCPT ); Sat, 28 Mar 2020 19:56:01 -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 relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 5A6551BF205; Sat, 28 Mar 2020 23:55:56 +0000 (UTC) Date: Sat, 28 Mar 2020 16:55:47 -0700 From: Josh Triplett To: Andreas Dilger Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, Theodore Ts'o , Andreas Dilger Subject: Re: [PATCH] ext4: Fix incorrect group count in ext4_fill_super error message Message-ID: <20200328235547.GB27571@localhost> References: <8b957cd1513fcc4550fe675c10bcce2175c33a49.1585431964.git.josh@joshtriplett.org> <04E7F659-18B0-4CD2-8DE9-F69310BC3B06@dilger.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <04E7F659-18B0-4CD2-8DE9-F69310BC3B06@dilger.ca> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat, Mar 28, 2020 at 05:07:55PM -0600, Andreas Dilger wrote: > On Mar 28, 2020, at 3:54 PM, Josh Triplett wrote: > > > > 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") > > Modulo the compiler warning pointed out by kbuild test robot, I think the > patch is correct, but was definitely confusing to read within the shown > context, since "blocks_count" definitely doesn't seem to be "groups count" > (it *is* the "groups count", but is just used as a temporary variable). I agree that the code and patch read confusingly due to the (lack of) context. The commit message attempted to explain that, but clearer code seems preferable to confusing-but-explained code. I sent a new version of this patch, which instead just moves the assignment to sbi's group count earlier, so that the error message can continue referencing it that way. (That also addresses the warning.) - Josh Triplett