linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] io_uring: Try to merge io requests only for regular files
@ 2021-03-19  5:28 Dmitry Monakhov
  2021-03-19  6:36 ` Greg KH
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Dmitry Monakhov @ 2021-03-19  5:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-fsdevel, stable, axboe, Dmitry Monakhov

Otherwise we may endup blocking on pipe or socket.

Fixes: 6d5d5ac ("io_uring: extend async work merge")
Testcase: https://github.com/dmonakhov/liburing/commit/16d171b6ef9d68e6db66650a83d98c5c721d01f6
Signed-off-by: Dmitry Monakhov <dmtrmonakhov@yandex-team.ru>
---
 fs/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 478df7e..848657c 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2183,6 +2183,9 @@ static int __io_submit_sqe(struct io_ring_ctx *ctx, struct io_kiocb *req,
 static struct async_list *io_async_list_from_req(struct io_ring_ctx *ctx,
 						 struct io_kiocb *req)
 {
+	if (!(req->flags & REQ_F_ISREG))
+		return NULL;
+
 	switch (req->submit.opcode) {
 	case IORING_OP_READV:
 	case IORING_OP_READ_FIXED:
-- 
2.7.4


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

end of thread, other threads:[~2021-03-19 14:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-19  5:28 [PATCH] io_uring: Try to merge io requests only for regular files Dmitry Monakhov
2021-03-19  6:36 ` Greg KH
2021-03-19  7:45 ` Dmitry Monakhov
2021-03-19 10:23 ` Pavel Begunkov
2021-03-19 14:06 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).