mbox series

[v5,0/3] ext4: fix a inode checksum error

Message ID 20210901020955.1657340-1-yi.zhang@huawei.com
Headers show
Series ext4: fix a inode checksum error | expand

Message

Zhang Yi Sept. 1, 2021, 2:09 a.m. UTC
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<y>? yes
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    Inode bitmap differences:  -17
    Fix<y>? yes
    Free inodes count wrong for group #0 (32750, counted=32751).
    Fix<y>? yes
    Free inodes count wrong (32750, counted=32751).
    Fix<y>? 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(-)

Comments

Zhang Yi Oct. 14, 2021, 10:57 a.m. UTC | #1
Hi, Ted. Do you consider to merge this remaining patch set?

Thanks,
Yi.

On 2021/9/1 10:09, Zhang Yi wrote:
> 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<y>? yes
>     Pass 3: Checking directory connectivity
>     Pass 4: Checking reference counts
>     Pass 5: Checking group summary information
>     Inode bitmap differences:  -17
>     Fix<y>? yes
>     Free inodes count wrong for group #0 (32750, counted=32751).
>     Fix<y>? yes
>     Free inodes count wrong (32750, counted=32751).
>     Fix<y>? 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(-)
>
Theodore Ts'o Oct. 28, 2021, 2:47 p.m. UTC | #2
On Wed, 1 Sep 2021 10:09:52 +0800, Zhang Yi wrote:
> 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
> 
> [...]

Applied, thanks!

[1/3] ext4: factor out ext4_fill_raw_inode()
      commit: 6a6af6b5ee4363e29fc86552ddfd94c5000d845d
[2/3] ext4: move ext4_fill_raw_inode() related functions
      commit: 4bc2b511975a6fe5ce9f2b2dcc84b152354d1f90
[3/3] ext4: prevent getting empty inode buffer
      commit: fb5becb151d54652ae613e34157f1aadb8447ed8

Best regards,