From patchwork Tue Jul 10 22:11:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Mostafa X-Patchwork-Id: 942266 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41QGdH24k8z9s2g; Wed, 11 Jul 2018 08:11:45 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1fd0rB-0000ye-8a; Tue, 10 Jul 2018 22:11:37 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1fd0r9-0000yH-8h for kernel-team@lists.ubuntu.com; Tue, 10 Jul 2018 22:11:35 +0000 Received: from 1.general.kamal.us.vpn ([10.172.68.52] helo=fourier) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fd0r8-0007jC-SF; Tue, 10 Jul 2018 22:11:35 +0000 Received: from kamal by fourier with local (Exim 4.86_2) (envelope-from ) id 1fd0r6-0002na-JZ; Tue, 10 Jul 2018 15:11:32 -0700 From: Kamal Mostafa To: kernel-team@lists.ubuntu.com Subject: [SRU][Bionic][PATCH 1/1] UBUNTU: SAUCE: ext4: fix ext4_validate_inode_bitmap: comm stress-ng: Corrupt inode bitmap Date: Tue, 10 Jul 2018 15:11:31 -0700 Message-Id: <1531260691-10706-2-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531260691-10706-1-git-send-email-kamal@canonical.com> References: <1531260691-10706-1-git-send-email-kamal@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dann frazier MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: "Theodore Y. Ts'o" BugLink: http://bugs.launchpad.net/bugs/1780137 Fix regression triggered by the stress-ng[*] "chdir" test, with LKML test patch. Regression observed on some arm64 server platforms: EXT4-fs error (device sda1): ext4_validate_inode_bitmap:99: comm stress-ng: Corrupt inode bitmap Reference: https://lkml.org/lkml/2018/7/7/2 Reported-by: dann frazier Tested-by: dann frazier Fixes: 044e6e3d74a3 ext4: don't update checksum of new initialized bitmaps Signed-off-by: Kamal Mostafa Acked-by: Colin Ian King --- fs/ext4/ialloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 5559313..b5e2cc2 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -91,6 +91,8 @@ static int ext4_validate_inode_bitmap(struct super_block *sb, return -EFSCORRUPTED; ext4_lock_group(sb, block_group); + if (buffer_verified(bh)) + goto verified; blk = ext4_inode_bitmap(sb, desc); if (!ext4_inode_bitmap_csum_verify(sb, block_group, desc, bh, EXT4_INODES_PER_GROUP(sb) / 8)) { @@ -108,6 +110,7 @@ static int ext4_validate_inode_bitmap(struct super_block *sb, return -EFSBADCRC; } set_buffer_verified(bh); +verified: ext4_unlock_group(sb, block_group); return 0; }