]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: close lookup gap for dependent next work
authorJens Axboe <axboe@kernel.dk>
Wed, 20 Nov 2019 20:05:32 +0000 (13:05 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Nov 2019 02:56:10 +0000 (19:56 -0700)
commit7ae0fc9ed4a7fefa8e53b9812db38ff50ed4fe19
treed4524d43a2ed92ccfec694ab2db3807a8985ef88
parent71fef9783070d7aa0161ee523afd6d2d1a8a8116
io_uring: close lookup gap for dependent next work

When we find new work to process within the work handler, we queue the
linked timeout before we have issued the new work. This can be
problematic for very short timeouts, as we have a window where the new
work isn't visible.

Allow the work handler to store a callback function for this in the work
item, and flag it with IO_WQ_WORK_CB if the caller has done so. If that
is set, then io-wq will call the callback when it has setup the new work
item.

Reported-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c
fs/io-wq.h
fs/io_uring.c