Whamcloud - gitweb
LU-15420 sec: fix native fscrypt builds 44/57344/2
authorJames Simmons <jsimmons@infradead.org>
Mon, 9 Dec 2024 16:08:59 +0000 (11:08 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 2 Jan 2025 20:52:09 +0000 (20:52 +0000)
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 <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57344
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/linux/linux-prim.c
libcfs/libcfs/module.c
lustre/llite/crypto.c
lustre/llite/llite_internal.h

index b5e2518..d417180 100644 (file)
@@ -47,7 +47,6 @@
 #endif
 
 #include <lustre_compat.h>
-#include <libcfs/crypto/llcrypt.h>
 #include <libcfs/linux/linux-time.h>
 #include <libcfs/linux/linux-wait.h>
 #include <libcfs/linux/linux-misc.h>
@@ -55,6 +54,7 @@
 #ifndef HAVE_XARRAY_SUPPORT
 #include <libcfs/linux/xarray.h>
 #endif
+#include <lustre_crypto.h>
 
 #ifndef HAVE_KTIME_GET_TS64
 void ktime_get_ts64(struct timespec64 *ts)
index 642b9ce..68e81a7 100644 (file)
@@ -51,7 +51,7 @@
 
 #include <libcfs/libcfs.h>
 #include <lnet/lib-lnet.h>
-#include <lustre_crypto.h>
+#include <uapi/linux/lustre/lustre_ver.h>
 #include "tracefile.h"
 
 int cpu_npartitions;
index f3e41a7..c299dd9 100644 (file)
@@ -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);
 
index 32bae6d..ba40b0b 100644 (file)
@@ -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);