]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix an issue when IOSQE_IO_LINK is inserted into defer list
authorJackie Liu <liuyun01@kylinos.cn>
Wed, 14 Aug 2019 09:35:22 +0000 (17:35 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 15 Aug 2019 17:21:39 +0000 (11:21 -0600)
commitcd270be4d003a108538ecd19596696a906b6eb01
tree1086aec4590f89b11422f491c0887e38cb5864e0
parent8881f9ecd5174819f8c5bd4dec33370704519403
io_uring: fix an issue when IOSQE_IO_LINK is inserted into defer list

This patch may fix two issues:

First, when IOSQE_IO_DRAIN set, the next IOs need to be inserted into
defer list to delay execution, but link io will be actively scheduled to
run by calling io_queue_sqe.

Second, when multiple LINK_IOs are inserted together with defer_list,
the LINK_IO is no longer keep order.

   |-------------|
   |   LINK_IO   |      ----> insert to defer_list  -----------
   |-------------|                                            |
   |   LINK_IO   |      ----> insert to defer_list  ----------|
   |-------------|                                            |
   |   LINK_IO   |      ----> insert to defer_list  ----------|
   |-------------|                                            |
   |   NORMAL_IO |      ----> insert to defer_list  ----------|
   |-------------|                                            |
                                                              |
                              queue_work at same time   <-----|

Fixes: 69d25089d03 ("io_uring: add support for sqe links")
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c