From: Keith Busch A bio requesting sectors unaligned to the logical format is invalid rather than an IO error. Fix up the return code because there are some device mappers that care about distinguishing these kinds of errors. Signed-off-by: Keith Busch --- block/blk-mq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index d0c37daf568f2..881183345a85c 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -3182,7 +3182,8 @@ void blk_mq_submit_bio(struct bio *bio) * have to be done with queue usage counter held. */ if (unlikely(bio_unaligned(bio, q))) { - bio_io_error(bio); + bio->bi_status = BLK_STS_INVAL; + bio_endio(bio); goto queue_exit; } -- 2.53.0-Meta