]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix deadlock on iowq file slot alloc
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 1 Jun 2022 14:28:44 +0000 (15:28 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 Jun 2022 16:12:41 +0000 (10:12 -0600)
commitfa61fee7c14598b76065a8631ca0d16d40fc5eac
tree6641f4cc04ffc4d1b6482f99880638f7e976577b
parent3c02192c8665d03253d7881ec9a7ce59ea141ba7
io_uring: fix deadlock on iowq file slot alloc

io_fixed_fd_install() can grab uring_lock in the slot allocation path
when called from io-wq, and then call into io_install_fixed_file(),
which will lock it again. Pull all locking out of
io_install_fixed_file() into io_fixed_fd_install().

Fixes: 49ced758645b5 ("io_uring: allow allocated fixed files for openat/openat2")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/64116172a9d0b85b85300346bb280f3657aafc26.1654087283.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c