From: Pavel Begunkov Date: Wed, 13 Nov 2019 21:11:01 +0000 (+0300) Subject: io_uring: Fix getting file for non-fd opcodes X-Git-Tag: v5.5-rc1~204^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a320e9fa1e2680116d165b9369dfa41d7cc1e1d1;p=thirdparty%2Fkernel%2Flinux.git io_uring: Fix getting file for non-fd opcodes For timeout requests and bunch of others io_uring tries to grab a file with specified fd, which is usually stdin/fd=0. Update io_op_needs_file() Signed-off-by: Pavel Begunkov Signed-off-by: Jens Axboe --- diff --git a/fs/io_uring.c b/fs/io_uring.c index 9500780bcaeac..55f8b1d378df1 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2599,6 +2599,10 @@ static bool io_op_needs_file(const struct io_uring_sqe *sqe) switch (op) { case IORING_OP_NOP: case IORING_OP_POLL_REMOVE: + case IORING_OP_TIMEOUT: + case IORING_OP_TIMEOUT_REMOVE: + case IORING_OP_ASYNC_CANCEL: + case IORING_OP_LINK_TIMEOUT: return false; default: return true;