Skip to content

Commit

Permalink
Revert "block: end bio with BLK_STS_AGAIN in case of non-mq devs and …
Browse files Browse the repository at this point in the history
…REQ_NOWAIT"

[ Upstream commit b0beb28 ]

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]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
axboe authored and gregkh committed Jun 3, 2020
1 parent 31f0b78 commit bba91cd
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,14 +886,11 @@ generic_make_request_checks(struct bio *bio)
}

/*
* Non-mq queues do not honor REQ_NOWAIT, so complete a bio
* with BLK_STS_AGAIN status in order to catch -EAGAIN and
* to give a chance to the caller to repeat request gracefully.
* 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)) {
status = BLK_STS_AGAIN;
goto end_io;
}
if ((bio->bi_opf & REQ_NOWAIT) && !queue_is_mq(q))
goto not_supported;

if (should_fail_bio(bio))
goto end_io;
Expand Down

0 comments on commit bba91cd

Please sign in to comment.