Whamcloud - gitweb
LU-16610 ldiskfs: fix directory corruption on openeuler 22.03 92/50192/2
authorXinliang Liu <xinliang.liu@linaro.org>
Thu, 23 Feb 2023 07:54:15 +0000 (07:54 +0000)
committerOleg Drokin <green@whamcloud.com>
Tue, 21 Mar 2023 23:16:19 +0000 (23:16 +0000)
commit85b76aa91a3999a325a9ef970f0cc8b6dd1cdda7
treedc266d57fdd60ae6397a40fe61dc5e8abde14a7c
parent5772650cc58891dc8f5208d307f539ffd1db7dbd
LU-16610 ldiskfs: fix directory corruption on openeuler 22.03

This fixes directory corruption error below.
LDISKFS-fs error (device dm-0): ldiskfs_find_dest_de:2412: inode
rec_len is smaller than minimal - offset=0, inode=0, rec_len=8,
name_len=0, size=4096

Fixes through
make up(&ei->i_append_sem) lock include ext4_journal_get_write_access()
like rhel9.1 ext4-pdirop.patch.
Remove the wrong the dx_move_dirents() call before condition "if
(hinfo->hash < hash2)" like other ext4-pdirop.patch.
Also move code part
if (indirect == level) { /* the last index level */
    struct ext4_dir_lock_data *ld;
u64 myblock;
...
}
after code part
block = dx_get_block(at);
for (i = 0; i <= level; i++) {
    ...
}

Change-Id: Ie33623ba4428d58f5c612871287c19e7e239755d
Test-Parameters: trivial
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50192
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
ldiskfs/kernel_patches/patches/oe2203/ext4-pdirop.patch