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>
Mon, 22 Jul 2019 03:46:29 +0000 (21:46 -0600)
commit6a43074e2f461c2c49a607f9f6f5218d53f97d1e
treee1781f5c8c89749b67b76157dcc8f57c75a581f1
parent893a1c97205a3ece0cbb3f571a3b972080f3b4c7
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