Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp200470pxb; Tue, 31 Aug 2021 19:05:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyN7zUbAnWsKxVxw4l5A2WD0Pai/RF3qxZmUrNaLupSv7Lb3XlItKvTzZlV3ZSU96VWQE+r X-Received: by 2002:aa7:cd9a:: with SMTP id x26mr31653719edv.384.1630461922922; Tue, 31 Aug 2021 19:05:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630461922; cv=none; d=google.com; s=arc-20160816; b=OBTo19vh3RcuWO1qJ2VJwkGdG+hPyiArq22HGp2zBzTz8zmsIrpVP3XOCrYPdALMu8 VdF4t0pWIOKfrCOhPOYjew1QjWTPy/SRDMJbL9ulmLjxRFOyzu6lNFBuxpc0IxkV6fY8 1RM9UJ/PTfjAy5NCimuIWQp1DkmptqivTzwu9Ns019SYUlQsshro7WwDh2CMCgKNce3L T6Gns9KvTgnp6u13KH0c6S8N0fgkwCINI2b/IacHrQ/twikUF50sj6LsX2nUcp3ztxWx kz7o1P8qClF5VtQtr6cwlmLszis6b2LzNYVmu5zxaKisP8Rlokw00PobbueewnHtPXh0 QG7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=JBh2qmhWhTI0aTeCJO6xCQQXXVtQ0lXMBEcdjsfN5jU=; b=joQv9rLUPlqoUPhiow2uH6ua769IXZHXNjbPpsZMWdHP0G4S7EUacRCl/W2F2SVGBQ OpmlCeR06rzYTivRuftWfRm5bPNlkR6YMFnbTDi4oi3oIb4KR2Qq9IDbeJ/M5MifsWNj zeUXpv3/+3FkH9AhDiWxVvnC0t3RmSGueVyA9IugL4W1pqtWOFgHRVGGZO/mouOYnuC0 aQrn9K7d5TXkTix/napiGKc1fAqsbXZ52qw0+qdBoKVBihCI2AZo/CQy9Aq1Fpea/4OQ dwla90xkFI228JeUDIaPPj9fz1G0ycmGf+YsjSK/esJDxYjI4oDdfjgToDvMaMAQEKYm yj3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si16783216edw.296.2021.08.31.19.04.58; Tue, 31 Aug 2021 19:05:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241309AbhIACBB (ORCPT + 99 others); Tue, 31 Aug 2021 22:01:01 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:9390 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231567AbhIACBB (ORCPT ); Tue, 31 Aug 2021 22:01:01 -0400 Received: from dggeme752-chm.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GznFv2MyNz8x82; Wed, 1 Sep 2021 09:55:47 +0800 (CST) Received: from huawei.com (10.175.127.227) by dggeme752-chm.china.huawei.com (10.3.19.98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Wed, 1 Sep 2021 10:00:01 +0800 From: Zhang Yi To: CC: , , , , Subject: [PATCH v5 0/3] ext4: fix a inode checksum error Date: Wed, 1 Sep 2021 10:09:52 +0800 Message-ID: <20210901020955.1657340-1-yi.zhang@huawei.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggeme752-chm.china.huawei.com (10.3.19.98) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org We find a checksum error and a inode corruption problem while doing stress test, this 3 patches address to fix them. The first two patches are prepare to do the fix, the last patch fix these two issue. - Checksum error EXT4-fs error (device sda): ext4_lookup:1784: inode #131074: comm cat: iget: checksum invalid - Inode corruption e2fsck 1.46.0 (29-Jan-2020) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Entry 'foo' in / (2) has deleted/unused inode 17. Clear? yes Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information Inode bitmap differences: -17 Fix? yes Free inodes count wrong for group #0 (32750, counted=32751). Fix? yes Free inodes count wrong (32750, counted=32751). Fix? yes Changes since v4: - Drop first three already applied patches. - Remove 'in_mem' parameter passing __ext4_get_inode_loc() in the last patch. Changes since v3: - Postpone initialization to ext4_do_update_inode() may cause zeroout newly set xattr entry. So switch to do initialization in __ext4_get_inode_loc(). Changes since v2: - Instead of using WARN_ON_ONCE to prevent ext4_do_update_inode() return before filling the inode buffer, keep the error and postpone the report after the updating in the third patch. - Fix some language mistacks in the last patch. Changes since v1: - Add a patch to prevent ext4_do_update_inode() return before filling the inode buffer. - Do not use BH_New flag to indicate the empty buffer, postpone the zero and uptodate logic into ext4_do_update_inode() before filling the inode buffer. Thanks, Yi. Zhang Yi (3): ext4: factor out ext4_fill_raw_inode() ext4: move ext4_fill_raw_inode() related functions ext4: prevent getting empty inode buffer fs/ext4/inode.c | 316 +++++++++++++++++++++++++----------------------- 1 file changed, 165 insertions(+), 151 deletions(-) -- 2.31.1