From ea3ee9337f9bcd42360e4523f1e34bcd04d3bf41 Mon Sep 17 00:00:00 2001 From: Andrew Perepechko Date: Mon, 14 Feb 2022 16:35:10 +0300 Subject: [PATCH] LU-15555 ldiskfs: large directory causes htree corruption When creating a lot of files in a single directory, it can get corrupted because of a typo in ext4-kill-dx-root.patch. Change-Id: Ia36278580741e1eb905e24a3a6231ba7daaa882a Fixes: 20a6d32 ("LU-12637 kernel: RHEL 8.1 server support") HPE-bug-id: LUS-10730 Signed-off-by: Andrew Perepechko Signed-off-by: Alexander Zarochentsev Signed-off-by: Artem Blagodarenko Reviewed-on: https://review.whamcloud.com/46526 Reviewed-by: Alexander Zarochentsev Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- ldiskfs/kernel_patches/patches/linux-5.4/ext4-kill-dx-root.patch | 2 +- ldiskfs/kernel_patches/patches/linux-5.8/ext4-kill-dx-root.patch | 2 +- ldiskfs/kernel_patches/patches/rhel8.1/ext4-kill-dx-root.patch | 2 +- ldiskfs/kernel_patches/patches/ubuntu18/ext4-kill-dx-root.patch | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ldiskfs/kernel_patches/patches/linux-5.4/ext4-kill-dx-root.patch b/ldiskfs/kernel_patches/patches/linux-5.4/ext4-kill-dx-root.patch index 0b071b9..b783219 100644 --- a/ldiskfs/kernel_patches/patches/linux-5.4/ext4-kill-dx-root.patch +++ b/ldiskfs/kernel_patches/patches/linux-5.4/ext4-kill-dx-root.patch @@ -232,7 +232,7 @@ index a1db7ce..b0291ed 100644 - dxroot->info.indirect_levels += 1; + info = dx_get_dx_info((struct ext4_dir_entry_2 *) + frames[0].bh->b_data); -+ info->indirect_levels = 1; ++ info->indirect_levels += 1; dxtrace(printk(KERN_DEBUG "Creating %d level index...\n", dxroot->info.indirect_levels)); diff --git a/ldiskfs/kernel_patches/patches/linux-5.8/ext4-kill-dx-root.patch b/ldiskfs/kernel_patches/patches/linux-5.8/ext4-kill-dx-root.patch index ef2a361..5b2c4cc 100644 --- a/ldiskfs/kernel_patches/patches/linux-5.8/ext4-kill-dx-root.patch +++ b/ldiskfs/kernel_patches/patches/linux-5.8/ext4-kill-dx-root.patch @@ -230,7 +230,7 @@ Subject: [PATCH] + linux-5.3/ext4-kill-dx-root - dxroot->info.indirect_levels += 1; + info = dx_get_dx_info((struct ext4_dir_entry_2 *) + frames[0].bh->b_data); -+ info->indirect_levels = 1; ++ info->indirect_levels += 1; dxtrace(printk(KERN_DEBUG "Creating %d level index...\n", dxroot->info.indirect_levels)); diff --git a/ldiskfs/kernel_patches/patches/rhel8.1/ext4-kill-dx-root.patch b/ldiskfs/kernel_patches/patches/rhel8.1/ext4-kill-dx-root.patch index b212574..3f1b75e 100644 --- a/ldiskfs/kernel_patches/patches/rhel8.1/ext4-kill-dx-root.patch +++ b/ldiskfs/kernel_patches/patches/rhel8.1/ext4-kill-dx-root.patch @@ -224,7 +224,7 @@ Index: linux-4.18.0-147.0.3.el8/fs/ext4/namei.c - dxroot->info.indirect_levels += 1; + info = dx_get_dx_info((struct ext4_dir_entry_2 *) + frames[0].bh->b_data); -+ info->indirect_levels = 1; ++ info->indirect_levels += 1; dxtrace(printk(KERN_DEBUG "Creating %d level index...\n", dxroot->info.indirect_levels)); diff --git a/ldiskfs/kernel_patches/patches/ubuntu18/ext4-kill-dx-root.patch b/ldiskfs/kernel_patches/patches/ubuntu18/ext4-kill-dx-root.patch index 62c507f..f496781 100644 --- a/ldiskfs/kernel_patches/patches/ubuntu18/ext4-kill-dx-root.patch +++ b/ldiskfs/kernel_patches/patches/ubuntu18/ext4-kill-dx-root.patch @@ -224,7 +224,7 @@ Index: linux-4.15.0/fs/ext4/namei.c - dxroot->info.indirect_levels += 1; + info = dx_get_dx_info((struct ext4_dir_entry_2 *) + frames[0].bh->b_data); -+ info->indirect_levels = 1; ++ info->indirect_levels += 1; dxtrace(printk(KERN_DEBUG "Creating %d level index...\n", info->indirect_levels)); -- 1.8.3.1