OSDN Git Service

block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT
authorRoman Penyaev <rpenyaev@suse.de>
Tue, 17 Dec 2019 15:54:07 +0000 (16:54 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 17 Dec 2019 16:01:43 +0000 (09:01 -0700)
commitc58c1f83436b501d45d4050fd1296d71a9760bcb
tree4c969a564987faf83e96654aa5f720ad4c963a76
parent1c05839aa973cfae8c3db964a21f9c0eef8fcc21
block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT

Non-mq devs do not honor REQ_NOWAIT so give a chance to the caller to repeat
request gracefully on -EAGAIN error.

The problem is well reproduced using io_uring:

   mkfs.ext4 /dev/ram0
   mount /dev/ram0 /mnt

   # Preallocate a file
   dd if=/dev/zero of=/mnt/file bs=1M count=1

   # Start fio with io_uring and get -EIO
   fio --rw=write --ioengine=io_uring --size=1M --direct=1 --name=job --filename=/mnt/file

Signed-off-by: Roman Penyaev <rpenyaev@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c