blk-mq: Fix stall due to recursive flush plug
[platform/kernel/linux-starfive.git] / block / blk-map.c
index 3473562..66da9e2 100644 (file)
@@ -246,7 +246,7 @@ static struct bio *blk_rq_map_bio_alloc(struct request *rq,
 {
        struct bio *bio;
 
-       if (rq->cmd_flags & REQ_POLLED) {
+       if (rq->cmd_flags & REQ_POLLED && (nr_vecs <= BIO_INLINE_VECS)) {
                blk_opf_t opf = rq->cmd_flags | REQ_ALLOC_CACHE;
 
                bio = bio_alloc_bioset(NULL, nr_vecs, opf, gfp_mask,