Merge tag 'drm-misc-fixes-2020-02-07' of git://anongit.freedesktop.org/drm/drm-misc...
[sfrench/cifs-2.6.git] / block / blk-core.c
index e0a094fddee5f3e16b660c8cab189987663cb7f7..089e890ab208fd01efbda68aea4fdb47aaab1353 100644 (file)
@@ -885,11 +885,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;