From 49bdb838154a62a01c829327fedd381e9977c0f9 Mon Sep 17 00:00:00 2001 From: Alexander Zarochentsev Date: Thu, 1 Sep 2022 10:19:15 -0700 Subject: [PATCH] LU-16082 ldiskfs: old-style EA inode handling fix The upstream version of EA inodes support coming with RHEL8 (linux kernel 4.18+) have a slightly different implementation of EA inodes support and also have a compatibility code to recognize old-style Lustre-only EAs. Unfortunately the compatibility code is broken and makes old xattr data unaccessible due to a wrong hash value check. Lustre-change: https://review.whamcloud.com/48174 Lustre-commit: 76c3fa96dc30f21e95d80f9119972d7358975258 HPE-bug-id: LUS-11133 Signed-off-by: Alexander Zarochentsev Change-Id: Icd6f93d4ebb33dcd03b58f9eb364905c18ae81dc Reviewed-by: Alex Zhuravlev Reviewed-by: Artem Blagodarenko Reviewed-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/48413 Tested-by: jenkins Tested-by: Maloo --- .../rhel8/ext4-old_ea_inodes_handling_fix.patch | 19 +++++++++++++++++++ .../kernel_patches/series/ldiskfs-4.18-rhel8.4.series | 1 + 2 files changed, 20 insertions(+) create mode 100644 ldiskfs/kernel_patches/patches/rhel8/ext4-old_ea_inodes_handling_fix.patch diff --git a/ldiskfs/kernel_patches/patches/rhel8/ext4-old_ea_inodes_handling_fix.patch b/ldiskfs/kernel_patches/patches/rhel8/ext4-old_ea_inodes_handling_fix.patch new file mode 100644 index 0000000..ac3a58f --- /dev/null +++ b/ldiskfs/kernel_patches/patches/rhel8/ext4-old_ea_inodes_handling_fix.patch @@ -0,0 +1,19 @@ +Index: linux-stage/fs/ext4/xattr.c +=================================================================== +--- linux-stage.orig/fs/ext4/xattr.c ++++ linux-stage/fs/ext4/xattr.c +@@ -415,10 +415,11 @@ static int ext4_xattr_inode_iget(struct + + /* + * Check whether this is an old Lustre-style xattr inode. Lustre +- * implementation does not have hash validation, rather it has a +- * backpointer from ea_inode to the parent inode. ++ * implementation sets ea_inode->i_atime.tv_sec to 0 ++ * (when md csum is off, means always) ++ * and backpointer from ea_inode to the parent inode. + */ +- if (ea_inode_hash != ext4_xattr_inode_get_hash(inode) && ++ if (ext4_xattr_inode_get_hash(inode) == 0 && + EXT4_XATTR_INODE_GET_PARENT(inode) == parent->i_ino && + inode->i_generation == parent->i_generation) { + ext4_set_inode_state(inode, EXT4_STATE_LUSTRE_EA_INODE); diff --git a/ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.4.series b/ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.4.series index ff52703..be8c0bd 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.4.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.4.series @@ -30,3 +30,4 @@ rhel8.4/ext4-enc-flag.patch rhel8/ext4-ialloc-uid-gid-and-pass-owner-down.patch base/ext4-projid-xattrs.patch rhel8.5/ext4-filename-encode.patch +rhel8/ext4-old_ea_inodes_handling_fix.patch -- 1.8.3.1