From patchwork Wed Feb 15 06:26:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 728066 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vNTpP3jJnz9s0m for ; Wed, 15 Feb 2017 17:26:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=thunk.org header.i=@thunk.org header.b="JB9Uh2GM"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751776AbdBOG0v (ORCPT ); Wed, 15 Feb 2017 01:26:51 -0500 Received: from imap.thunk.org ([74.207.234.97]:55852 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751617AbdBOG0u (ORCPT ); Wed, 15 Feb 2017 01:26:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=thunk.org; s=ef5046eb; h=Message-Id:Date:Subject:Cc:To:From; bh=JhcnOXfM1WOIIobVbL1V75sKk4NIQper6y0thaPCP7I=; b=JB9Uh2GMttXL8mSmUmxlKiVaP3FIkVRoe99FJ+Egm2KxRZIFNd5JggYOtaS7FPJFvONmRv2guIXb9jlpEZSqHNVzPCEbllp1+6j43NuN7Pt+taf8UXKvF+q2ifwK4sTEx57IKco8tZ9ehmNU376xxR5bDJQQVExMwU6zuNvGrJU=; Received: from root (helo=callcc.thunk.org) by imap.thunk.org with local-esmtp (Exim 4.84_2) (envelope-from ) id 1cdt34-0001nl-Rs; Wed, 15 Feb 2017 06:26:42 +0000 Received: by callcc.thunk.org (Postfix, from userid 15806) id F0671C0041F; Wed, 15 Feb 2017 01:26:41 -0500 (EST) From: Theodore Ts'o To: Ext4 Developers List Cc: Theodore Ts'o , stable@vger.kernel.org Subject: [PATCH] ext4: fix fencepost in s_first_meta_bg validation Date: Wed, 15 Feb 2017 01:26:41 -0500 Message-Id: <20170215062641.17620-1-tytso@mit.edu> X-Mailer: git-send-email 2.11.0.rc0.7.gbe5a750 X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org It is OK for s_first_meta_bg to be equal to the number of block group descriptor blocks. (It rarely happens, but it shouldn't cause any problems.) https://bugzilla.kernel.org/show_bug.cgi?id=194567 Fixes: 3a4b77cd47bb837b8557595ec7425f281f2ca1fe Signed-off-by: Theodore Ts'o Cc: stable@vger.kernel.org --- 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 dde14a7ac6d7..a673558fe5f8 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3860,7 +3860,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) db_count = (sbi->s_groups_count + EXT4_DESC_PER_BLOCK(sb) - 1) / EXT4_DESC_PER_BLOCK(sb); if (ext4_has_feature_meta_bg(sb)) { - if (le32_to_cpu(es->s_first_meta_bg) >= db_count) { + if (le32_to_cpu(es->s_first_meta_bg) > db_count) { ext4_msg(sb, KERN_WARNING, "first meta block group too large: %u " "(group descriptor block count %u)",