diff options
| author | Martin Cermak <mcermak@redhat.com> | 2025-10-24 12:13:10 +0200 |
|---|---|---|
| committer | Martin Cermak <mcermak@redhat.com> | 2025-10-24 12:13:10 +0200 |
| commit | db8590b5c46367425793459dcf27355a5b1f5771 (patch) | |
| tree | ee2e32bf8830925fc0bcbc31eed3c4e78887b0d0 | |
| parent | dropwatch.stp: Add packet drop reason. (diff) | |
PR33574: runtime/linux/stap_fs.h incompatible with kernel-6.18
Kernel 6.18 comes with commit 4055526d3 which moves ns type from struct proc_ns_operations into struct ns_common. This commit reflects that in systemtap runtime.
| -rw-r--r-- | buildrun.cxx | 1 | ||||
| -rw-r--r-- | runtime/linux/autoconf-pr33574-pno-type.c | 3 | ||||
| -rw-r--r-- | runtime/linux/stap_fs.h | 4 |
3 files changed, 8 insertions, 0 deletions
diff --git a/buildrun.cxx b/buildrun.cxx index 1f56a976b..c3e38a2db 100644 --- a/buildrun.cxx +++ b/buildrun.cxx | |||
| @@ -402,6 +402,7 @@ compile_pass (systemtap_session& s) | |||
| 402 | output_autoconf(s, o, cs, "autoconf-pr32194-uprobe-register-unregister.c", "STAPCONF_PR32194_UPROBE_REGISTER_UNREGISTER", NULL); | 402 | output_autoconf(s, o, cs, "autoconf-pr32194-uprobe-register-unregister.c", "STAPCONF_PR32194_UPROBE_REGISTER_UNREGISTER", NULL); |
| 403 | output_autoconf(s, o, cs, "autoconf-uprobes-cb-data.c", "STAPCONF_UPROBES_CB_DATA", NULL); | 403 | output_autoconf(s, o, cs, "autoconf-uprobes-cb-data.c", "STAPCONF_UPROBES_CB_DATA", NULL); |
| 404 | output_autoconf(s, o, cs, "autoconf-pr33324-prev_padding.c", "STAPCONF_PR33324_PREV_PADDING", NULL); | 404 | output_autoconf(s, o, cs, "autoconf-pr33324-prev_padding.c", "STAPCONF_PR33324_PREV_PADDING", NULL); |
| 405 | output_autoconf(s, o, cs, "autoconf-pr33574-pno-type.c", "STAPCONF_PR33574_PNO_TYPE", NULL); | ||
| 405 | 406 | ||
| 406 | output_dual_exportconf(s, o2, "probe_kernel_read", "probe_kernel_write", "STAPCONF_PROBE_KERNEL"); | 407 | output_dual_exportconf(s, o2, "probe_kernel_read", "probe_kernel_write", "STAPCONF_PROBE_KERNEL"); |
| 407 | output_autoconf(s, o, cs, "autoconf-hw_breakpoint_context.c", | 408 | output_autoconf(s, o, cs, "autoconf-hw_breakpoint_context.c", |
diff --git a/runtime/linux/autoconf-pr33574-pno-type.c b/runtime/linux/autoconf-pr33574-pno-type.c new file mode 100644 index 000000000..572816d52 --- /dev/null +++ b/runtime/linux/autoconf-pr33574-pno-type.c | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | #include <linux/proc_ns.h> | ||
| 2 | |||
| 3 | struct proc_ns_operations pno __attribute__ ((unused)) = {.type = 0x0}; | ||
diff --git a/runtime/linux/stap_fs.h b/runtime/linux/stap_fs.h index 3fee5d3ec..12b97b0e8 100644 --- a/runtime/linux/stap_fs.h +++ b/runtime/linux/stap_fs.h | |||
| @@ -69,7 +69,11 @@ stap_set_mnt_ns(int fd) | |||
| 69 | goto out; | 69 | goto out; |
| 70 | 70 | ||
| 71 | ns = get_proc_ns(file_inode(file)); | 71 | ns = get_proc_ns(file_inode(file)); |
| 72 | #if defined(STAPCONF_PR33574_PNO_TYPE) | ||
| 72 | if (ns->ops->type != CLONE_NEWNS) { | 73 | if (ns->ops->type != CLONE_NEWNS) { |
| 74 | #else | ||
| 75 | if (ns->ns_type != CLONE_NEWNS) { | ||
| 76 | #endif | ||
| 73 | err = -EINVAL; | 77 | err = -EINVAL; |
| 74 | goto out; | 78 | goto out; |
| 75 | } | 79 | } |
