diff --git a/fs/io_uring.c b/fs/io_uring.c index 34e540755c9f9..6ddafa3af1701 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5510,8 +5510,9 @@ static int io_poll_check_events(struct io_kiocb *req, bool locked) if (!req->result) { struct poll_table_struct pt = { ._key = poll->events }; + unsigned flags = locked ? 0 : IO_URING_F_UNLOCKED; - if (unlikely(!io_assign_file(req, IO_URING_F_UNLOCKED))) + if (unlikely(!io_assign_file(req, flags))) req->result = -EBADF; else req->result = vfs_poll(req->file, &pt) & poll->events;