Whamcloud - gitweb
LU-16091 enc: S_ENCRYPTED flag on OST objects for enc files 98/48198/12
authorSebastien Buisson <sbuisson@ddn.com>
Thu, 11 Aug 2022 15:08:11 +0000 (17:08 +0200)
committerOleg Drokin <green@whamcloud.com>
Fri, 13 Jan 2023 07:19:40 +0000 (07:19 +0000)
commit348446d6370b3f63f0da8a96997b3295f896c6fb
treeba731ba95485cf64ea393abee872e7032c319655
parentb1e2ca839f30a450059b2bc190ad2916ca16be82
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.

Test-Parameters: testlist=sanity-sec mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2 fstype=zfs
Test-Parameters: testlist=sanity-sec mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2 fstype=zfs
Test-Parameters: testlist=sanity-sec mdscount=2 mdtcount=4 osscount=1 ostcount=8 clientcount=2 fstype=zfs
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-on: https://review.whamcloud.com/c/fs/lustre-release/+/48198
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@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