summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/lttng/lttng-modules/0001-Fix-mm-create-the-new-vm_fault_t-type-v5.1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/lttng/lttng-modules/0001-Fix-mm-create-the-new-vm_fault_t-type-v5.1.patch')
-rw-r--r--recipes-kernel/lttng/lttng-modules/0001-Fix-mm-create-the-new-vm_fault_t-type-v5.1.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/recipes-kernel/lttng/lttng-modules/0001-Fix-mm-create-the-new-vm_fault_t-type-v5.1.patch b/recipes-kernel/lttng/lttng-modules/0001-Fix-mm-create-the-new-vm_fault_t-type-v5.1.patch
new file mode 100644
index 00000000..12e32e84
--- /dev/null
+++ b/recipes-kernel/lttng/lttng-modules/0001-Fix-mm-create-the-new-vm_fault_t-type-v5.1.patch
@@ -0,0 +1,66 @@
1From 55026979d71852aa2cf5e19bb4adb2db98affd1e Mon Sep 17 00:00:00 2001
2From: Michael Jeanson <mjeanson@efficios.com>
3Date: Mon, 18 Mar 2019 16:20:32 -0400
4Subject: [PATCH 1/5] Fix: mm: create the new vm_fault_t type (v5.1)
5
6See upstream commit:
7
8 commit 3d3539018d2cbd12e5af4a132636ee7fd8d43ef0
9 Author: Souptick Joarder <jrdr.linux@gmail.com>
10 Date: Thu Mar 7 16:31:14 2019 -0800
11
12 mm: create the new vm_fault_t type
13
14 Page fault handlers are supposed to return VM_FAULT codes, but some
15 drivers/file systems mistakenly return error numbers. Now that all
16 drivers/file systems have been converted to use the vm_fault_t return
17 type, change the type definition to no longer be compatible with 'int'.
18 By making it an unsigned int, the function prototype becomes
19 incompatible with a function which returns int. Sparse will detect any
20 attempts to return a value which is not a VM_FAULT code.
21
22 VM_FAULT_SET_HINDEX and VM_FAULT_GET_HINDEX values are changed to avoid
23 conflict with other VM_FAULT codes.
24
25Upstream-Status: Backport [http://git.lttng.org/?p=lttng-modules.git;a=commit;h=2ca0c84f0b4a915c555a0b83102d94ac941619ca]
26
27Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
28Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
29---
30 lib/ringbuffer/ring_buffer_mmap.c | 12 +++++++++++-
31 1 file changed, 11 insertions(+), 1 deletion(-)
32
33diff --git a/lib/ringbuffer/ring_buffer_mmap.c b/lib/ringbuffer/ring_buffer_mmap.c
34index 4b1b7b3..6592a82 100644
35--- a/lib/ringbuffer/ring_buffer_mmap.c
36+++ b/lib/ringbuffer/ring_buffer_mmap.c
37@@ -32,7 +32,11 @@
38 /*
39 * fault() vm_op implementation for ring buffer file mapping.
40 */
41+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0))
42+static vm_fault_t lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fault *vmf)
43+#else
44 static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fault *vmf)
45+#endif
46 {
47 struct lib_ring_buffer *buf = vma->vm_private_data;
48 struct channel *chan = buf->backend.chan;
49@@ -65,7 +69,13 @@ static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fa
50 return 0;
51 }
52
53-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
54+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0))
55+static vm_fault_t lib_ring_buffer_fault(struct vm_fault *vmf)
56+{
57+ struct vm_area_struct *vma = vmf->vma;
58+ return lib_ring_buffer_fault_compat(vma, vmf);
59+}
60+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
61 static int lib_ring_buffer_fault(struct vm_fault *vmf)
62 {
63 struct vm_area_struct *vma = vmf->vma;
64--
652.17.0
66