From: Li Lingfeng lilingfeng3@huawei.com
Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I6BTWC
-------------------
Commit 5125c6de8709("[Backport] io_uring: import 5.15-stable io_uring") changes some structs, so we need to fix kabi broken problem.
Signed-off-by: Li Lingfeng lilingfeng3@huawei.com Reviewed-by: Zhang Yi yi.zhang@huawei.com Reviewed-by: Wang Weiyang wangweiyang2@huawei.com Signed-off-by: Jialin Zhang zhangjialin11@huawei.com --- include/linux/io_uring.h | 31 +++++++++++++++++++++++++++++++ include/linux/sched.h | 5 +---- include/linux/syscalls.h | 2 +- io_uring/io-wq.h | 2 +- io_uring/io_uring.c | 8 ++++++-- 5 files changed, 40 insertions(+), 8 deletions(-)
diff --git a/include/linux/io_uring.h b/include/linux/io_uring.h index 649a4d7c241b..026e1b33bbcf 100644 --- a/include/linux/io_uring.h +++ b/include/linux/io_uring.h @@ -5,6 +5,37 @@ #include <linux/sched.h> #include <linux/xarray.h>
+struct io_identity { + struct files_struct *files; + struct mm_struct *mm; +#ifdef CONFIG_BLK_CGROUP + struct cgroup_subsys_state *blkcg_css; +#endif + const struct cred *creds; + struct nsproxy *nsproxy; + struct fs_struct *fs; + unsigned long fsize; +#ifdef CONFIG_AUDIT + kuid_t loginuid; + unsigned int sessionid; +#endif + refcount_t count; +}; + +#ifdef __GENKSYMS__ +struct io_uring_task { + /* submission side */ + struct xarray xa; + struct wait_queue_head wait; + struct file *last; + struct percpu_counter inflight; + struct io_identity __identity; + struct io_identity *identity; + atomic_t in_idle; + bool sqpoll; +}; +#endif + #if defined(CONFIG_IO_URING) struct sock *io_uring_get_socket(struct file *file); void __io_uring_cancel(bool cancel_all); diff --git a/include/linux/sched.h b/include/linux/sched.h index 961acc4fa738..4c6e8c5183fb 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -925,9 +925,6 @@ struct task_struct { /* CLONE_CHILD_CLEARTID: */ int __user *clear_child_tid;
- /* PF_IO_WORKER */ - void *pf_io_worker; - u64 utime; u64 stime; #ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME @@ -1424,7 +1421,7 @@ struct task_struct { #else KABI_RESERVE(6) #endif - KABI_RESERVE(7) + KABI_USE(7, void *pf_io_worker) KABI_RESERVE(8) KABI_RESERVE(9) KABI_RESERVE(10) diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index a058c96cf213..aea0ce9f3b74 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -341,7 +341,7 @@ asmlinkage long sys_io_uring_setup(u32 entries, struct io_uring_params __user *p); asmlinkage long sys_io_uring_enter(unsigned int fd, u32 to_submit, u32 min_complete, u32 flags, - const void __user *argp, size_t argsz); + const sigset_t __user *sig, size_t sigsz); asmlinkage long sys_io_uring_register(unsigned int fd, unsigned int op, void __user *arg, unsigned int nr_args);
diff --git a/io_uring/io-wq.h b/io_uring/io-wq.h index bf5c4c533760..b33033b0d5a3 100644 --- a/io_uring/io-wq.h +++ b/io_uring/io-wq.h @@ -2,7 +2,7 @@ #define INTERNAL_IO_WQ_H
#include <linux/refcount.h> - +#include <linux/io_uring.h> struct io_wq;
enum { diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 473dbd1830a3..a200750b536c 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -461,6 +461,7 @@ struct io_ring_ctx { }; };
+#ifndef __GENKSYMS__ struct io_uring_task { /* submission side */ int cached_refs; @@ -477,6 +478,7 @@ struct io_uring_task { struct callback_head task_work; bool task_running; }; +#endif
/* * First field must be the file pointer in all the @@ -9850,13 +9852,15 @@ static int io_get_ext_arg(unsigned flags, const void __user *argp, size_t *argsz }
SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit, - u32, min_complete, u32, flags, const void __user *, argp, - size_t, argsz) + u32, min_complete, u32, flags, const sigset_t __user *, sig, + size_t, sigsz) { struct io_ring_ctx *ctx; int submitted = 0; struct fd f; long ret; + const void __user *argp = (const void __user *) sig; + size_t argsz = sigsz;
io_run_task_work();