Whamcloud - gitweb
LU-16091 enc: S_ENCRYPTED flag on OST objects for enc files
authorSebastien Buisson <sbuisson@ddn.com>
Thu, 11 Aug 2022 15:08:11 +0000 (17:08 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 25 Apr 2023 03:42:17 +0000 (03:42 +0000)
commit74dd153b9772e79d9778f1b92e5f5316bfe3efcd
treedc1d7770e4e4cff802d176ec032744aff12084a2
parent4a92a4b366bf7ab07773469323e403d53c414d72
LU-16091 enc: S_ENCRYPTED flag on OST objects for enc files

Add a dumb encryption context on OST objects being created, when the
LUSTRE_ENCRYPT_FL flag gets set in the LMA, for ldiskfs backend
targets. This leads ldiskfs to internally set the LDISKFS_ENCRYPT_FL
flag on the on-disk inode. Also, it makes e2fsprogs happy to see an
enc ctx for an inode that has the LDISKFS_ENCRYPT_FL flag.

Add a dumb encryption context on OST objects being opened, if there is
not already one, for ldiskfs backend targets. This is done by adding
the LUSTRE_ENCRYPT_FL flag if necessary, at the same time as atime
gets updated. It is some sort of live self-check that fixes OST
objects created with an older Lustre version.

Enhance lfsck to detect and fix OST objects belonging to encrypted
files that are missing the encryption flag. This is implemented in the
MDT-OST consistency routine, as part of the layout checking.

Also add sanity-sec test_62 and sanity-lfsck test_42 to exercise this.

Note this patch does not add any dumb encryption context on OST
objects when the backend is ZFS.

Lustre-change: https://review.whamcloud.com/48198
Lustre-commit: 348446d6370b3f63f0da8a96997b3295f896c6fb

Test-Parameters: testlist=sanity-sec mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2 fstype=zfs
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I6bee3c82ee4d1a52275facf9e2b0d60061e0beef
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/49896
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
17 files changed:
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/rhel8.4/ext4-enc-flag.patch
ldiskfs/kernel_patches/patches/rhel8.5/ext4-enc-flag.patch
ldiskfs/kernel_patches/patches/rhel8/ext4-enc-flag.patch
lustre/include/obd_support.h
lustre/lfsck/lfsck_layout.c
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/ofd/ofd_io.c
lustre/osc/osc_request.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/osd_object.c
lustre/osp/osp_object.c
lustre/tests/sanity-lfsck.sh
lustre/tests/sanity-sec.sh