block: properly handle IOCB_NOWAIT for async O_DIRECT IO
authorJens Axboe <axboe@kernel.dk>
Tue, 16 Jul 2019 19:56:42 +0000 (13:56 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 17 Jul 2019 20:00:12 +0000 (14:00 -0600)
commitd2865ad1c014afdbb3da69ca39a89ec233e57636
tree908d5f31b4ad3d2945ae43335cf248b7050edfb1
parente0cc142d5c5cc7a2161b044b2da5b0ef38534d83
block: properly handle IOCB_NOWAIT for async O_DIRECT IO

A caller is supposed to pass in REQ_NOWAIT if we can't block for any
given operation, but O_DIRECT for block devices just ignore this. Hence
we'll block for various resource shortages on the block layer side,
like having to wait for requests.

Use the new REQ_NOWAIT_INLINE to ask for this error to be returned
inline, so we can handle it appropriately and return -EAGAIN to the
caller.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/block_dev.c