Skip to content

Commit b0beb28

Browse files
committed
Revert "block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT"
This reverts commit c58c1f8. io_uring does do the right thing for this case, and we're still returning -EAGAIN to userspace for the cases we don't support. Revert this change to avoid doing endless spins of resubmits. Cc: [email protected] # v5.6 Reported-by: Bijan Mottahedeh <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 15fede1 commit b0beb28

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

block/blk-core.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -891,14 +891,11 @@ generic_make_request_checks(struct bio *bio)
891891
}
892892

893893
/*
894-
* Non-mq queues do not honor REQ_NOWAIT, so complete a bio
895-
* with BLK_STS_AGAIN status in order to catch -EAGAIN and
896-
* to give a chance to the caller to repeat request gracefully.
894+
* For a REQ_NOWAIT based request, return -EOPNOTSUPP
895+
* if queue is not a request based queue.
897896
*/
898-
if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q)) {
899-
status = BLK_STS_AGAIN;
900-
goto end_io;
901-
}
897+
if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q))
898+
goto not_supported;
902899

903900
if (should_fail_bio(bio))
904901
goto end_io;

0 commit comments

Comments
 (0)