From: Christoph Hellwig Date: Thu, 3 Mar 2016 21:43:45 +0000 (-0700) Subject: block: fix blk_rq_get_max_sectors for driver private requests X-Git-Tag: MMI-PSA29.97-13-9~8421^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f21018427cb007a0894c36ad702990ab639cbbb4;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git block: fix blk_rq_get_max_sectors for driver private requests Driver private request types should not get the artifical cap for the FS requests. This is important to use the full device capabilities for internal command or NVMe pass through commands. Signed-off-by: Christoph Hellwig Reported-by: Jeff Lien Tested-by: Jeff Lien Reviewed-by: Keith Busch Updated by me to use an explicit check for the one command type that does support extended checking, instead of relying on the ordering of the enum command values - as suggested by Keith. Signed-off-by: Jens Axboe --- diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d7f6bca707ef..413c84fbc4ed 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -895,7 +895,7 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq) { struct request_queue *q = rq->q; - if (unlikely(rq->cmd_type == REQ_TYPE_BLOCK_PC)) + if (unlikely(rq->cmd_type != REQ_TYPE_FS)) return q->limits.max_hw_sectors; if (!q->limits.chunk_sectors || (rq->cmd_flags & REQ_DISCARD))