io_uring: don't rely on weak ->files references
Grab actual references to the files_struct. To avoid circular references issues due to this, we add a per-task note that keeps track of what io_uring contexts a task has used. When the tasks execs or exits its assigned files, we cancel requests based on this tracking. With that, we can grab proper references to the files table, and no longer need to rely on stashing away ring_fd and ring_file to check if the ring_fd may have been closed. Cc: stable@vger.kernel.org # v5.5+ Reviewed-by:Pavel Begunkov <asml.silence@gmail.com> Signed-off-by:
Jens Axboe <axboe@kernel.dk>
parent
e6c8aa9a
No related branches found
No related tags found
Showing
- fs/exec.c 6 additions, 0 deletionsfs/exec.c
- fs/file.c 2 additions, 0 deletionsfs/file.c
- fs/io_uring.c 269 additions, 37 deletionsfs/io_uring.c
- include/linux/io_uring.h 53 additions, 0 deletionsinclude/linux/io_uring.h
- include/linux/sched.h 5 additions, 0 deletionsinclude/linux/sched.h
- init/init_task.c 3 additions, 0 deletionsinit/init_task.c
- kernel/fork.c 6 additions, 0 deletionskernel/fork.c
Loading
Please register or sign in to comment