Whamcloud - gitweb
LU-15848 ldiskfs: escape encrypted file names 09/47309/8
authorSebastien Buisson <sbuisson@ddn.com>
Wed, 11 May 2022 13:42:29 +0000 (15:42 +0200)
committerOleg Drokin <green@whamcloud.com>
Fri, 27 May 2022 20:39:11 +0000 (20:39 +0000)
commitfa7c81e81442c8d1ed0ce1c457769f2e144ff2c3
tree98268deb6bcdf91dceaa349778a889b528d0ec6f
parentc524079f4f59a39b99467d9868ee4aafdcf033e9
LU-15848 ldiskfs: escape encrypted file names

When a Lustre MDT is mounted as ldiskfs, the names of the encrypted
files have to be escaped to avoid breaking the shell.
On CentOS 7, the LDISKFS_ENCRYPT_FL flag does not exist. So we add it,
and when the target is mounted as ldiskfs (LDISKFS_MOUNT_DIRDATA flag
not present) we critical-encode encrypted file names before
presentation. And conversely, we critical-decode names upon lookup.
On CentOS 8, the LDISKFS_ENCRYPT_FL flag exists. The fscrypt functions
from kernel 4.18 are also wired up, but they all refer to -EOPNOTSUPP
or equivalent, so they cannot be used to present usable names. So when
the target is mounted as ldiskfs (LDISKFS_MOUNT_DIRDATA flag not
present) we proceed to critical-encoding of encrypted file names
before presentation, and to critical-decoding upon lookup.

Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Iaca467eaa233be8142356efa822962953754c2ce
Reviewed-on: https://review.whamcloud.com/47309
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
21 files changed:
ldiskfs/Makefile.in
ldiskfs/autoMakefile.am
ldiskfs/kernel_patches/patches/linux-5.4/ext4-enc-flag.patch
ldiskfs/kernel_patches/patches/linux-5.8/ext4-enc-flag.patch
ldiskfs/kernel_patches/patches/rhel7.9/ext4-enc-flag.patch
ldiskfs/kernel_patches/patches/rhel7.9/ext4-filename-encode.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/rhel8.4/ext4-enc-flag.patch
ldiskfs/kernel_patches/patches/rhel8.5/ext4-enc-flag.patch
ldiskfs/kernel_patches/patches/rhel8.5/ext4-filename-encode.patch [new file with mode: 0644]
ldiskfs/kernel_patches/patches/rhel8/ext4-enc-flag.patch
ldiskfs/kernel_patches/patches/rhel8/ext4-filename-encode.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.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