Whamcloud - gitweb
LU-12056 ldiskfs: add trusted.projid virtual xattr 79/45679/10
authorLi Dongyang <dongyangli@ddn.com>
Tue, 30 Nov 2021 01:13:03 +0000 (12:13 +1100)
committerOleg Drokin <green@whamcloud.com>
Thu, 6 Jan 2022 21:59:08 +0000 (21:59 +0000)
commit665383d3a1f4d1dc7f404301039432271ad85eaf
tree3c03bba5b662df9c5c468e1d346388a17cb5e3e4
parentcf872dcce3b33d309d31dc5cce8794729f14a924
LU-12056 ldiskfs: add trusted.projid virtual xattr

Add trusted.projid virtual xattr in ldiskfs to export the
current project id, intended for ldiskfs level MDT backup.

When the project id is EXT4_DEF_PROJID/0,
the virtual xattr is hidden from listxattr(2).

It's also hidden on lustre client when parent has the
project inherit flag and the same project ID,
to stop mv from setting the virtual xattr on the dest with
the project id from src, which could be different from dest.

getxattr(2) on trusted.projid will report current project id,
setxattr(2) will change curent project id and
removexattr(2) will set project id back to EXT4_DEF_PROJID/0

Both get|setxattr(2) will work even when the virtual xattr is
hidden.

Invalidate client xattr cache for the inode when changing its
project id, so the virtual xattr can get the new value
for next getxattr(2)

Add test cases to verify the virtual projid xattr and backup
restore MDT using tar can now preserve the project id.

Change mds_backup_restore in test framework, to use
tar with --xattrs --xattrs-include='trusted.*'" options.

Change-Id: I29b1aa922ef72d734cdc87125401fa08fb13d4af
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/45679
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
37 files changed:
ldiskfs/kernel_patches/patches/base/ext4-projid-xattrs.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/rhel7.6/ext4-projid-xattrs.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/ubuntu18/ext4-projid-xattrs.patch [new file with mode: 0644]
ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.6.series
ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.7.series
ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.8.series
ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.9.series
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.1.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.2.series
ldiskfs/kernel_patches/series/ldiskfs-4.18-rhel8.3.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.series
ldiskfs/kernel_patches/series/ldiskfs-5.0.0-13-ubuntu19.series
ldiskfs/kernel_patches/series/ldiskfs-5.4.0-42-ubuntu20.series
ldiskfs/kernel_patches/series/ldiskfs-5.4.0-66-ubuntu20.series
ldiskfs/kernel_patches/series/ldiskfs-5.4.0-80-ubuntu20.series
ldiskfs/kernel_patches/series/ldiskfs-5.4.0-90-ubuntu20.series
ldiskfs/kernel_patches/series/ldiskfs-5.4.0-ml.series
ldiskfs/kernel_patches/series/ldiskfs-5.4.136-ml.series
ldiskfs/kernel_patches/series/ldiskfs-5.4.21-ml.series
ldiskfs/kernel_patches/series/ldiskfs-5.8.0-53-ubuntu20.series
ldiskfs/kernel_patches/series/ldiskfs-5.8.0-ml.series
ldiskfs/kernel_patches/series/ldiskfs-5.9.0-ml.series
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/llite/xattr.c
lustre/llite/xattr_cache.c
lustre/mdt/mdt_reint.c
lustre/tests/conf-sanity.sh
lustre/tests/sanity.sh
lustre/tests/test-framework.sh