Modify blk_mq_plug() to allow plugging only for read operations in zoned block devices as there are alternative IO paths in the linux block layer which can end up doing a write via driver private requests in sequential write zones. Signed-off-by: Pankaj Raghav <p.raghav@xxxxxxxxxxx> --- block/blk-mq.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block/blk-mq.h b/block/blk-mq.h index 8ca453ac243d..005343df64ca 100644 --- a/block/blk-mq.h +++ b/block/blk-mq.h @@ -305,14 +305,15 @@ static inline void blk_mq_clear_mq_map(struct blk_mq_queue_map *qmap) * change can cause write BIO failures with zoned block devices as these * require sequential write patterns to zones. Prevent this from happening by * ignoring the plug state of a BIO issuing context if it is for a zoned block - * device and the BIO to plug is a write operation. + * device and the BIO to plug is not a read operation. + * * * Return current->plug if the bio can be plugged and NULL otherwise */ static inline struct blk_plug *blk_mq_plug( struct bio *bio) { - /* Zoned block device write operation case: do not plug the BIO */ - if (bdev_is_zoned(bio->bi_bdev) && op_is_write(bio_op(bio))) + /* Allow plugging only for read operations in zoned block devices */ + if (bdev_is_zoned(bio->bi_bdev) && bio_op(bio) != REQ_OP_READ) return NULL; /* -- 2.25.1