summaryrefslogtreecommitdiff
path: root/SOURCE
diff options
context:
space:
mode:
authorzy <[email protected]>2023-10-18 07:23:08 -0400
committerzy <[email protected]>2023-10-18 07:23:08 -0400
commit337acc9531f0cb75d895de71d2a50a85c090faac (patch)
treec18a07298f218cf27ed3da611eda26aa762c3e1c /SOURCE
parent787f115f2c2ee6121ce4b8f5236285f2e5819514 (diff)
more fix
Diffstat (limited to 'SOURCE')
-rwxr-xr-xSOURCE/module/misc.c5
-rw-r--r--SOURCE/module/pub/fs_utils.c5
-rw-r--r--SOURCE/module/pub/trace_file.c8
-rw-r--r--SOURCE/module/pub/uprobe.c8
4 files changed, 23 insertions, 3 deletions
diff --git a/SOURCE/module/misc.c b/SOURCE/module/misc.c
index f9d535f..220b9de 100755
--- a/SOURCE/module/misc.c
+++ b/SOURCE/module/misc.c
@@ -590,7 +590,12 @@ void diag_task_brief(struct task_struct *tsk, struct diag_task_detail *detail)
detail->pid = tsk->pid;
detail->tgid = tsk->tgid;
+// [[PATCH v2 7/7] sched: Change task_struct::state](https://lore.kernel.org/all/[email protected]/#r)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
detail->state = tsk->state;
+#else
+ detail->state = tsk->__state;
+#endif
detail->task_type = diag_get_task_type(tsk);
ns = task_active_pid_ns(tsk);
if (ns && ns != &init_pid_ns) {
diff --git a/SOURCE/module/pub/fs_utils.c b/SOURCE/module/pub/fs_utils.c
index fe2ea36..e3f834a 100644
--- a/SOURCE/module/pub/fs_utils.c
+++ b/SOURCE/module/pub/fs_utils.c
@@ -158,7 +158,12 @@ void *for_each_files_task(struct task_struct *tsk,
rcu_read_lock();
for (fd = 0; fd < files_fdtable(files)->max_fds; fd++) {
+//[[PATCH v2 09/24] file: Replace fcheck_files with files_lookup_fd_rcu](https://lore.kernel.org/lkml/[email protected]/#r)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
file = fcheck_files(files, fd);
+#else
+ file = files_lookup_fd_rcu(files, fd);
+#endif
if (!file)
continue;
diff --git a/SOURCE/module/pub/trace_file.c b/SOURCE/module/pub/trace_file.c
index 96016f4..39b1196 100644
--- a/SOURCE/module/pub/trace_file.c
+++ b/SOURCE/module/pub/trace_file.c
@@ -63,11 +63,17 @@ static struct diag_trace_file *to_trace_file(struct file *file)
return NULL;
return PDE_DATA(file->f_dentry->d_inode);
-#else
+// [PDE_DATA() replaced by pde_data()](https://github.com/openzfs/zfs/issues/13004)
+#elseif LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
if (!file->f_inode)
return NULL;
return PDE_DATA(file->f_inode);
+#else
+ if (!file->f_inode)
+ return NULL;
+
+ return pde_data(file->f_inode);
#endif
}
diff --git a/SOURCE/module/pub/uprobe.c b/SOURCE/module/pub/uprobe.c
index f9e5858..50d9750 100644
--- a/SOURCE/module/pub/uprobe.c
+++ b/SOURCE/module/pub/uprobe.c
@@ -43,8 +43,12 @@ int hook_uprobe(int fd, loff_t offset, struct diag_uprobe *diag_uprobe)
files = orig_get_files_struct(current);
if (!files)
goto out;
-
- file = fcheck_files(files, fd);
+//[[PATCH v2 09/24] file: Replace fcheck_files with files_lookup_fd_rcu](https://lore.kernel.org/lkml/[email protected]/#r)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
+ file = fcheck_files(files, fd);
+#else
+ file = files_lookup_fd_rcu(files, fd);
+#endif
if (!file)
goto out_put;