diff --git a/block/blk-core.c b/block/blk-core.c index 33488b1426b7bea98300e3e9845488d99109a515..36a57a79572b1ac307104573db1c551b8b7fb0ac 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -2446,10 +2446,8 @@ blk_qc_t generic_make_request(struct bio *bio) flags = 0; if (bio->bi_opf & REQ_NOWAIT) flags = BLK_MQ_REQ_NOWAIT; - if (blk_queue_enter(q, flags) < 0) { + if (blk_queue_enter(q, flags) < 0) enter_succeeded = false; - q = NULL; - } } if (enter_succeeded) { @@ -2480,6 +2478,7 @@ blk_qc_t generic_make_request(struct bio *bio) bio_wouldblock_error(bio); else bio_io_error(bio); + q = NULL; } bio = bio_list_pop(&bio_list_on_stack[0]); } while (bio);