summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-04 16:02:10 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-07 15:35:47 +0100
commit1410d2b68207cbb3bc16a4db7d655f5e06a39929 (patch)
treef00590c63eff524972303f060dba950fafb72d4a /block
parent5e8776df14fa8b88b00ba833f6947c88fec95570 (diff)
downloadlinux-stable-1410d2b68207cbb3bc16a4db7d655f5e06a39929.tar.gz
linux-stable-1410d2b68207cbb3bc16a4db7d655f5e06a39929.tar.bz2
linux-stable-1410d2b68207cbb3bc16a4db7d655f5e06a39929.zip
Revert "Revert "block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT""
This reverts commit bba91cdba612fbce4f8575c5d94d2b146fb83ea3 which is commit b0beb28097fa04177b3769f4bb7a0d0d9c4ae76e upstream. It breaks things in 5.4.y, so let's drop it. Reported-by: Andres Freund <andres@anarazel.de> Cc: Bijan Mottahedeh <bijan.mottahedeh@oracle.com> CC: Jens Axboe <axboe@kernel.dk> Cc: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index d2213220099d..5808baa950c3 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -886,11 +886,14 @@ generic_make_request_checks(struct bio *bio)
}
/*
- * For a REQ_NOWAIT based request, return -EOPNOTSUPP
- * if queue is not a request based queue.
+ * 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.
*/
- 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;
+ }
if (should_fail_bio(bio))
goto end_io;