OSDN Git Service

io_uring: punt even fadvise() WILLNEED to async context
authorJens Axboe <axboe@kernel.dk>
Sat, 1 Feb 2020 16:22:49 +0000 (09:22 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Feb 2020 00:27:47 +0000 (17:27 -0700)
commit3e69426da2599677ebbe76e2d97a606c4797bd74
tree74c3ba56ba6dcd4ed8bb684b837820d4b325d215
parent1a417f4e618e05fba29ba222f1e8555c302376ce
io_uring: punt even fadvise() WILLNEED to async context

Andres correctly points out that read-ahead can block, if it needs to
read in meta data (or even just through the page cache page allocations).
Play it safe for now and just ensure WILLNEED is also punted to async
context.

While in there, allow the file settings hints from non-blocking
context. They don't need to start/do IO, and we can safely do them
inline.

Fixes: 4840e418c2fc ("io_uring: add IORING_OP_FADVISE")
Reported-by: Andres Freund <andres@anarazel.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c