Whamcloud - gitweb
LU-15420 sec: handle simple fscrypt changes for 5.15 kernels 25/49125/22
authorJames Simmons <jsimmons@infradead.org>
Wed, 8 Feb 2023 13:04:45 +0000 (08:04 -0500)
committerOleg Drokin <green@whamcloud.com>
Fri, 17 Feb 2023 02:25:24 +0000 (02:25 +0000)
commit048e2cc7d2d52870a48c4df2abd3944114c96271
tree7ffe09c3b1d412718f632a1f9c665ad3c14d1cf9
parent63dd644747f4eab20d640b4d87060e56c20bc37f
LU-15420 sec: handle simple fscrypt changes for 5.15 kernels

The patch covers the low impact changes to the Linux kernels
fscrypt API. The changes are:

For Linux kernel version 5.9-rc4 the following commits are:

8b10fe68985278de4926daa56ad6af701839e40a removed the inode
parameter for the fscrypt function fscrypt_fname_alloc_buffer()

5b2a828b98ec1872799b1b4d82113c76a12d594f ended up exporting
fscrypt_d_revalidate() and stopped stomping on the d_ops.

c8c868abc91ff23f6f5c4444c419de7c277d77e1 changed
fscrypt_set_test_dummy_encryption() take a 'const char *

ac4acb1f4b2b6b7e8d913537cccec8789903e164 moved the fscrypt core
from using fscrypt_context to using fscrypt_policy that is user
forward facing.

Lastly for Linux kernel version 5.10-rc4 the commit

ec0caa974cd092549ab282deb8ec7ea73b36eba0 stopped exporting
fscrypt_get_encryption_info(). Use fscrypt_prepare_readdir()
in its place.

70fb2612aab62d47e03f82eaa7384a8d30ca175d renamed a field in
struct fscrypt_name. Since Lustre can't use fscrypt_prepare_lookup
we have to deal with this change.

Remove sptlrpc_enc_pool_del_user() since its an empty function
that waste cycles calling it.

The other large change was the replacement of
fscrypt_inherit_context which is described in Linux commit
a992b20cd4ee360dbbe6f69339cb07146e4304d6. This change is very
large since it expects the target inode to be available. Lustre
uses fscrypt_inherit_context before the inode is available so
this is a much more complex change that will be done in another
patch.

de3cdc6e75179a2324c23400b21483a1372c95e1 makes fscrypt_require_key
private. You need to test the key's presence with
fscrypt_has_encryption_key() instead but that key needs to be
setup first by the new function fscrypt_prepare_new_inode().
Since this is the case we wait to introduce this change.

Change-Id: I4bed7fef6e3302c0258c0f1563f4e180258d7a5a
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49125
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
14 files changed:
lustre/autoconf/lustre-core.m4
lustre/include/lustre_crypto.h
lustre/include/lustre_disk.h
lustre/include/lustre_sec.h
lustre/llite/crypto.c
lustre/llite/dcache.c
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/llite_lib.c
lustre/llite/lproc_llite.c
lustre/llite/namei.c
lustre/ptlrpc/gss/sec_gss.c
lustre/ptlrpc/sec_bulk.c