Whamcloud - gitweb
LU-12275 sec: disable bio functions on client
authorAndreas Dilger <adilger@whamcloud.com>
Thu, 16 Feb 2023 16:10:13 +0000 (09:10 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 17 Feb 2023 19:35:33 +0000 (19:35 +0000)
The reference to bio_alloc() on the client is causing compile
issues with different kernels and adds unnecessary portability
complexity to the client code.

Disable llcrypt_zeroout_range() for client builds because it is
not needed since direct block device access is not used by llite.

Lustre-change: https://review.whamcloud.com/50023
Lustre-commit: TBD (from 0ebb7e37b85f8e881985bdcb45d3e16ace37c1f0)

Test-Parameters: trivial
Fixes: a813e8187 ("LU-12275 sec: add llcrypt as file encryption library")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I97642dfd85053b9ea4196374f2002ffb6a2540e5
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/50022
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
libcfs/include/libcfs/crypto/llcrypt.h
libcfs/libcfs/crypto/bio.c

index b152915..93e1766 100644 (file)
@@ -267,12 +267,14 @@ static inline bool llcrypt_match_name(const struct llcrypt_name *fname,
        return !memcmp(de_name, fname->disk_name.name, fname->disk_name.len);
 }
 
+#ifdef HAVE_SERVER_SUPPORT
 /* bio.c */
 extern void llcrypt_decrypt_bio(struct bio *);
 extern void llcrypt_enqueue_decrypt_bio(struct llcrypt_ctx *ctx,
                                        struct bio *bio);
 extern int llcrypt_zeroout_range(const struct inode *, pgoff_t, sector_t,
                                 unsigned int);
+#endif
 
 /* hooks.c */
 extern int llcrypt_file_open(struct inode *inode, struct file *filp);
@@ -525,6 +527,7 @@ static inline bool llcrypt_match_name(const struct llcrypt_name *fname,
        return !memcmp(de_name, fname->disk_name.name, fname->disk_name.len);
 }
 
+#ifdef HAVE_SERVER_SUPPORT
 /* bio.c */
 static inline void llcrypt_decrypt_bio(struct bio *bio)
 {
@@ -540,6 +543,7 @@ static inline int llcrypt_zeroout_range(const struct inode *inode, pgoff_t lblk,
 {
        return -EOPNOTSUPP;
 }
+#endif
 
 /* hooks.c */
 
index a0e96db..1ddad13 100644 (file)
@@ -24,6 +24,7 @@
  * tags/v5.4
  */
 
+#ifdef HAVE_SERVER_SUPPORT
 #include <linux/pagemap.h>
 #include <linux/module.h>
 #include <linux/bio.h>
@@ -126,3 +127,4 @@ errout:
        return err;
 }
 EXPORT_SYMBOL(llcrypt_zeroout_range);
+#endif