diff mbox series

block: clear REQ_HIPRI if polling is not supported

Message ID 20181214162122.14937-1-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series block: clear REQ_HIPRI if polling is not supported | expand

Commit Message

Christoph Hellwig Dec. 14, 2018, 4:21 p.m. UTC
This prevents a HIPRI bio from being submitted through a stacking
driver that does not support polling and thus won't poll for I/O
completion.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-core.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jens Axboe Dec. 14, 2018, 4:47 p.m. UTC | #1
On 12/14/18 9:21 AM, Christoph Hellwig wrote:
> This prevents a HIPRI bio from being submitted through a stacking
> driver that does not support polling and thus won't poll for I/O
> completion.

Applied, thanks.
diff mbox series

Patch

diff --git a/block/blk-core.c b/block/blk-core.c
index 268d2b8e9843..efa10789ddc0 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -921,6 +921,9 @@  generic_make_request_checks(struct bio *bio)
 		}
 	}
 
+	if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
+		bio->bi_opf &= ~REQ_HIPRI;
+
 	switch (bio_op(bio)) {
 	case REQ_OP_DISCARD:
 		if (!blk_queue_discard(q))