From ec4bc9c6007df4207cf3a84128caf3b030fe2f8d Mon Sep 17 00:00:00 2001 From: James Simmons Date: Mon, 9 Dec 2024 11:08:59 -0500 Subject: [PATCH] LU-15420 sec: fix native fscrypt builds The recent changes in libcfs prevents native fscrypt from building. Replace llcrypt.h with lustre_crypto.h in linux-prim.c which will build under all conditions. We really only need llcrypt_[init|exit] for this code. The new symlink fix for fscrypt also breaks when building native fscrypt. Now 5.9 or less kernels will build natively and it pass all testing. Test-Parameters: trivial Fixes: 209607fd79 ("LU-18096 enc: ll_get_symlink overlay function") Change-Id: I8230364604992150da5bbfb27a3407e99e212ba6 Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57344 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- libcfs/libcfs/linux/linux-prim.c | 2 +- libcfs/libcfs/module.c | 2 +- lustre/llite/crypto.c | 2 +- lustre/llite/llite_internal.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libcfs/libcfs/linux/linux-prim.c b/libcfs/libcfs/linux/linux-prim.c index b5e2518..d417180 100644 --- a/libcfs/libcfs/linux/linux-prim.c +++ b/libcfs/libcfs/linux/linux-prim.c @@ -47,7 +47,6 @@ #endif #include -#include #include #include #include @@ -55,6 +54,7 @@ #ifndef HAVE_XARRAY_SUPPORT #include #endif +#include #ifndef HAVE_KTIME_GET_TS64 void ktime_get_ts64(struct timespec64 *ts) diff --git a/libcfs/libcfs/module.c b/libcfs/libcfs/module.c index 642b9ce..68e81a7 100644 --- a/libcfs/libcfs/module.c +++ b/libcfs/libcfs/module.c @@ -51,7 +51,7 @@ #include #include -#include +#include #include "tracefile.h" int cpu_npartitions; diff --git a/lustre/llite/crypto.c b/lustre/llite/crypto.c index f3e41a7..c299dd9 100644 --- a/lustre/llite/crypto.c +++ b/lustre/llite/crypto.c @@ -481,7 +481,7 @@ const char *ll_get_symlink(struct inode *inode, const void *caddr, struct lu_fid fid; int rc; - rc = llcrypt_get_encryption_info(inode); + rc = llcrypt_prepare_readdir(inode); if (rc) return ERR_PTR(rc); diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index 32bae6d..ba40b0b 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -2151,7 +2151,7 @@ int ll_prepare_lookup(struct inode *dir, struct dentry *de, int ll_setup_filename(struct inode *dir, const struct qstr *iname, int lookup, struct llcrypt_name *fname, struct lu_fid *fid); -#ifdef CONFIG_LL_ENCRYPTION +#ifdef HAVE_LUSTRE_CRYPTO const char *ll_get_symlink(struct inode *inode, const void *caddr, unsigned int max_size, struct delayed_call *done); -- 1.8.3.1