From 0b267633e1648ef0ddc9fce9c22ca6300091cceb Mon Sep 17 00:00:00 2001 From: Angelos Mouzakitis Date: Wed, 29 Nov 2023 12:41:33 +0100 Subject: Add conditional build for kernels after 5.11 The function fcheck_files() is replaced by files_lookup_fd_rcu() on kernel version > 5.11.0 Bug-AGL: SPEC-4834 Change-Id: Ie4adb383252a35066d1ed3be1caad29883503af5 Signed-off-by: Angelos Mouzakitis --- loopback_driver.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/loopback_driver.c b/loopback_driver.c index 452726c..950b2cb 100644 --- a/loopback_driver.c +++ b/loopback_driver.c @@ -65,6 +65,7 @@ #include #include +#include /* Features */ MODULE_LICENSE("GPL v2"); @@ -1165,8 +1166,11 @@ static long loopback_ioctl(struct file *file, userspace_task = pid_task(find_vpid(efd_data.pid), PIDTYPE_PID); rcu_read_lock(); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,11,0) efd_file = files_lookup_fd_rcu(userspace_task->files, efd_data.efd[0]); +#else rcu_read_unlock(); +#endif efd_ctx = eventfd_ctx_fileget(efd_file); if (!efd_ctx) -- cgit 1.2.3-korg