Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp200875pxb; Fri, 20 Aug 2021 23:45:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxlIO2iO3LE57o8shiu6aDqUS674qiOGdvIX0J14Y4VtHOWNvIQyBH2iYORCxrb5AmG3zA X-Received: by 2002:a05:6e02:e8b:: with SMTP id t11mr16082915ilj.175.1629528308892; Fri, 20 Aug 2021 23:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629528308; cv=none; d=google.com; s=arc-20160816; b=vivHikwqlViVJLHZc+dUF8wOwFOzJbPFfnwnTniiiE3Ww0S7KxL/THRyhaU09Nkfjv zJx7rDG26w7FzzQMI9ODqMDqZAUanL0w+tqdl0IuFeJ18OwuN6bboz5Lr9HaaghI6wdm ppbaVuR2JOrNXLDxWoG7vDSNIpQAwYdjSScpLcjyJPAhxjyWlC7tbBX8FqoHbY5QdDBV VJ44Idfr1PzHErA4H8lmWEe3MfGP3656hb5DB1CFJz2XQPVg7jW9HVY+tWjDcT/CCmy8 bZzRAkFHgOSnmAyq+3cFKnSyRp4McahMWPg9ry3oV6msSNbhN9APbOMk1qVi1szax7cy 5big== 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=wAjr8oCYYskOyoA9Q/TjV9lseoj8HKjNSkH/j7IELLk=; b=UKGQglYABIE4hmNBHLDAqXTCeUefku+51uFkN+FR3HGIH33RMtrUgitG6unRXtBOJF FCeHiBI7iOhRXyJIZ8Ek3LZRs8ybYPqdHbo3wHfd6lFFr1W0CV9F0d8oRTxjp1Q4j1+M O/kUItYQByQyIYBjpiBP9ING/L4WWTBea+99/dRnaJho/8/axGsFOzk0q1iAN3H5iwQj rh+KqcnClPBL0PtDKToQpSQEz8FaQrrBxp86wSLb6B9iWUxs0wcPmmAhjAUXvwIajWpr xFNTCQW7UgGgKjzucpIaS58Hvkg3pvhWqlM4PqV7XJjzo/f7LYk+3UaI9HlbQh4N+v0m jsGw== 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 o14si10775673ilj.89.2021.08.20.23.44.34; Fri, 20 Aug 2021 23:45:08 -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 S232037AbhHUGpJ (ORCPT + 99 others); Sat, 21 Aug 2021 02:45:09 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:8916 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230375AbhHUGpJ (ORCPT ); Sat, 21 Aug 2021 02:45:09 -0400 Received: from dggeme752-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Gs85L2LqRz8snr; Sat, 21 Aug 2021 14:40:22 +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.2176.2; Sat, 21 Aug 2021 14:44:27 +0800 From: Zhang Yi To: CC: , , , , Subject: [PATCH v3 0/4] ext4: fix a inode checksum error Date: Sat, 21 Aug 2021 14:54:46 +0800 Message-ID: <20210821065450.1397451-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: dggems701-chm.china.huawei.com (10.3.19.178) 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 4 patches address to fix them. The first patch is relate to the error simulation, and the second & third patch 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 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 (4): ext4: move inode eio simulation behind io completeion ext4: remove an unnecessary if statement in __ext4_get_inode_loc() ext4: make the updating inode data procedure atomic ext4: prevent getting empty inode buffer fs/ext4/inode.c | 227 +++++++++++++++++++++++++++--------------------- 1 file changed, 126 insertions(+), 101 deletions(-) -- 2.31.1