]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit9a18839e8004c71ad901e7ec5018dd999dffba65
tree4c969a564987faf83e96654aa5f720ad4c963a76
parent7ff54fed20c1b30564e817aaf70f64cb92c30c5c
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