@@ -889,20 +889,31 @@ generic_make_request_checks(struct bio *bio)
/*
* For a REQ_NOWAIT based request, return -EOPNOTSUPP
* if queue is not a request based queue.
*/
- if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q))
- goto not_supported;
+ if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q)) {
+ status = BLK_STS_AGAIN;
+ goto end_io;
+ }
(and this works) but I'm afraid that should degrade performance, since
on each IO we hit the error deeply in the stack, rewind the stack and
repeat the whole procedure from a worker.
Other confusing thing is that when io_uring writes directly to /dev/ram0
no errors are returned, because eventually bio is created and does not
inherit NOWAIT flag on this path:
__blkdev_direct_IO():
bio->bi_opf = dio_bio_write_op(iocb);
as opposed to writing directly to a file on the same ram dev, where all
flags are inherited from dio:
__blockdev_direct_IO
do_blockdev_direct_IO
dio_send_cur_page
dio_new_bio
dio_bio_alloc():
bio_set_op_attrs(bio, dio->op, dio->op_flags);