Commit 976517f1 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

io_uring: fix blocking inline submission

There is a complaint against sys_io_uring_enter() blocking if it submits
stdin reads. The problem is in __io_file_supports_async(), which
sees that it's a cdev and allows it to be processed inline.

Punt char devices using generic rules of io_file_supports_async(),
including checking for presence of *_iter() versions of rw callbacks.
Apparently, it will affect most of cdevs with some exceptions like
null and zero devices.

Cc: stable@vger.kernel.org
Reported-by: default avatarBirk Hirdman <lonjil@gmail.com>
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/d60270856b8a4560a639ef5f76e55eb563633599.1623236455.git.asml.silence@gmail.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 40dad765
...@@ -2618,7 +2618,7 @@ static bool __io_file_supports_async(struct file *file, int rw) ...@@ -2618,7 +2618,7 @@ static bool __io_file_supports_async(struct file *file, int rw)
return true; return true;
return false; return false;
} }
if (S_ISCHR(mode) || S_ISSOCK(mode)) if (S_ISSOCK(mode))
return true; return true;
if (S_ISREG(mode)) { if (S_ISREG(mode)) {
if (IS_ENABLED(CONFIG_BLOCK) && if (IS_ENABLED(CONFIG_BLOCK) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment