public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: fix blocking inline submission
@ 2021-06-09 11:07 Pavel Begunkov
  2021-06-09 12:42 ` Hao Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Pavel Begunkov @ 2021-06-09 11:07 UTC (permalink / raw)
  To: Jens Axboe, io-uring

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.

Signed-off-by: Pavel Begunkov <[email protected]>
---

"...For now, just ensure that anything potentially problematic is done
inline". I believe this part is outdated, but what use cases we miss?
Anything that we care about?

IMHO the best option is to do like in this patch and add
(read,write)_iter(), to places we care about.

/dev/[u]random, consoles, any else?

 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 42380ed563c4..44d1859f0dfb 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2616,7 +2616,7 @@ static bool __io_file_supports_async(struct file *file, int rw)
 			return true;
 		return false;
 	}
-	if (S_ISCHR(mode) || S_ISSOCK(mode))
+	if (S_ISSOCK(mode))
 		return true;
 	if (S_ISREG(mode)) {
 		if (IS_ENABLED(CONFIG_BLOCK) &&
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-06-14 10:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-09 11:07 [PATCH] io_uring: fix blocking inline submission Pavel Begunkov
2021-06-09 12:42 ` Hao Xu
2021-06-14 10:24   ` Pavel Begunkov
2021-06-09 15:07 ` Jens Axboe
2021-06-09 15:34   ` Pavel Begunkov
2021-06-09 15:36     ` Jens Axboe
2021-06-09 15:41       ` Pavel Begunkov
2021-06-09 15:43         ` Jens Axboe
2021-06-09 15:47           ` Pavel Begunkov
2021-06-14  9:30             ` Pavel Begunkov
2021-06-09 15:38 ` Pavel Begunkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox