Whamcloud - gitweb
LU-15420 sec: handle fscrypt_require_key removal in newer kernels 54/57754/8
authorJames Simmons <jsimmons@infradead.org>
Thu, 10 Apr 2025 14:46:03 +0000 (10:46 -0400)
committerOleg Drokin <green@whamcloud.com>
Fri, 25 Apr 2025 00:53:55 +0000 (00:53 +0000)
commitf0e0176eb40851a543ba07fd4fb334df6688219f
treeb81a1d3731f8c0028604caf5ef93ba2c83ffb5cc
parentdcd5f6c0a0139c9d0f338509b19d9e4dce01a29e
LU-15420 sec: handle fscrypt_require_key removal in newer kernels

Kernel commit de3cdc6e75179a2324c moved fscrypt_require_key()
to the fscrypt_private.h which makes it no longer visible.
With this change move to fscrypt_has_encryption_key() which
existed for some time. Once difference is
fscrypt_has_encryption_key() reports success when the inode has
no encryption so we need to test IS_ENCRYPT(inode) as well.
Expand the ll_has_encryption_key() to also test for IS_ENCRYPT
since this is the most common use case.

Update LLCRYPT_FNAME_DIGEST to LLCRYPT_EXTRACT_DIGEST for mdd
layer.

Test-Parameters: trivial testlist=sanity-sec
Change-Id: I402f222f635e7c0f026c53093bb17ec4d461e189
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57754
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_crypto.h
lustre/llite/crypto.c
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_lib.c
lustre/llite/pcc.c
lustre/mdd/mdd_dir.c
lustre/tests/sanity-sec.sh