Commit 3e3fb92e authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Kamal Mostafa

block: fix blk_rq_get_max_sectors for driver private requests

BugLink: http://bugs.launchpad.net/bugs/1588449

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: default avatarChristoph Hellwig <hch@lst.de>
Reported-by: default avatarJeff Lien <Jeff.Lien@hgst.com>
Tested-by: default avatarJeff Lien <Jeff.Lien@hgst.com>
Reviewed-by: default avatarKeith Busch <keith.busch@intel.com>

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: default avatarJens Axboe <axboe@fb.com>
(cherry picked from commit f2101842)
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent b3f17fff
......@@ -890,7 +890,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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment