Whamcloud - gitweb
LU-17711 osd-ldiskfs: do not delete dotdot during rename 23/54723/10
authorLi Dongyang <dongyangli@ddn.com>
Wed, 17 Apr 2024 05:36:55 +0000 (15:36 +1000)
committerOleg Drokin <green@whamcloud.com>
Mon, 10 Jun 2024 06:08:53 +0000 (06:08 +0000)
commit0536b2a26992f5d2ef9e3537a196afac81281f60
tree862959e2fa150c5eef2904d8889d7f206f36af34
parent9d9b8cbaa4123df708a072acd1a4f30120075418
LU-17711 osd-ldiskfs: do not delete dotdot during rename

Since upstream kernel commit v5.12-rc4-32-g6c0912739699
ext4_dir_entry_2 after rec_len will be wiped when deleting
the entry.

This creates a problem with rename, when we delete dotdot
first and if it's a dx dir, kernel will wipe entire dx_root
in the block after dotdot entry.

We can just update the dotdot entry in-place without deleting.

For dx dirs, ext4_update_dotdot() takes care of dotdot and
inserting dotdot is an update, use it for linear dirs also.

Rewrite ext4_update_dotdot() to get a few fixes:
*use ext4_read_dirblock to get the first block.
*do not assert on data read from disk, we check the dot and
dotdot entry and if anything looks wrong, we return -EFSCORRUPTED.
*make sure the change is journalled.
*set metadata_csum correctly for dx dirs.

Update ext4-data-in-dirent.patch, if dotdot entry has no space
for dirdata, try to expand the dotdot entry by moving the
entries behind it, or move the dx_root for dx dirs.

Add conf-sanity/154 to verify that the ".." entry was updated
properly after restore, including with an htree split directory
with dx_root entry.

Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Change-Id: I33e862739fa44f583aaa4369190d6d80271db13b
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54723
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: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
54 files changed:
ldiskfs/kernel_patches/patches/linux-5.10/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/linux-5.10/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/linux-5.4/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/linux-5.4/ext4-hash-indexed-dir-dotdot-update.patch
ldiskfs/kernel_patches/patches/linux-5.4/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/linux-5.8/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/linux-6.0/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/linux-6.0/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/oe2203/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/oe2203sp1/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/rhel7.6/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/rhel7.6/ext4-hash-indexed-dir-dotdot-update.patch
ldiskfs/kernel_patches/patches/rhel7.9/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/rhel8.4/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/rhel8.4/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/rhel8.7/ext4-hash-indexed-dir-dotdot-update.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/rhel8.7/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/rhel8/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/rhel9.1/ext4-data-in-dirent.patch [moved from ldiskfs/kernel_patches/patches/linux-5.18/ext4-data-in-dirent.patch with 86% similarity]
ldiskfs/kernel_patches/patches/rhel9.1/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/rhel9.2/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/rhel9.2/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/rhel9.3/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/rhel9/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/rhel9/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/sles15sp1/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/sles15sp3/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/sles15sp3/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/sles15sp4/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/sles15sp4/ext4-hash-indexed-dir-dotdot-update.patch
ldiskfs/kernel_patches/patches/sles15sp4/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/ubuntu18/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/ubuntu18/ext4-hash-indexed-dir-dotdot-update.patch [deleted file]
ldiskfs/kernel_patches/patches/ubuntu18/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/ubuntu20.04.5/ext4-data-in-dirent.patch
ldiskfs/kernel_patches/patches/ubuntu20/ext4-pdirop.patch
ldiskfs/kernel_patches/patches/ubuntu2004/ext4-pdirop.patch
ldiskfs/kernel_patches/series/ldiskfs-4.12-sles15-22.series
ldiskfs/kernel_patches/series/ldiskfs-4.12-sles15.series
ldiskfs/kernel_patches/series/ldiskfs-4.12-sles15sp1-7.series
ldiskfs/kernel_patches/series/ldiskfs-4.12-sles15sp1.series
ldiskfs/kernel_patches/series/ldiskfs-4.15.0-20-ubuntu18.series
ldiskfs/kernel_patches/series/ldiskfs-4.15.0-24-ubuntu18.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.4.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.5.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.6.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.7.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.8.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.9.series
ldiskfs/kernel_patches/series/ldiskfs-5.0.0-13-ubuntu19.series
ldiskfs/kernel_patches/series/ldiskfs-5.14-rhel9.1.series
lustre/osd-ldiskfs/osd_handler.c
lustre/tests/conf-sanity.sh
lustre/tests/test-framework.sh