From: Jens Axboe Date: Fri, 29 May 2015 19:11:32 +0000 (-0600) Subject: block: don't honor chunk sizes for data-less IO X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e548ca4ee4595f65b262661d166310ad8a149bec;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git block: don't honor chunk sizes for data-less IO We don't need to honor chunk sizes for IO that doesn't carry any data. Signed-off-by: Jens Axboe --- diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 9ded80da2c16..ccaa9aecd593 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -903,7 +903,7 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq) if (unlikely(rq->cmd_type == REQ_TYPE_BLOCK_PC)) return q->limits.max_hw_sectors; - if (!q->limits.chunk_sectors) + if (!q->limits.chunk_sectors || (rq->cmd_flags & REQ_DISCARD)) return blk_queue_get_max_sectors(q, rq->cmd_flags); return min(blk_max_size_offset(q, blk_rq_pos(rq)),