Skip to content

Commit

Permalink
block: don't honor chunk sizes for data-less IO
Browse files Browse the repository at this point in the history
We don't need to honor chunk sizes for IO that doesn't carry any
data.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed May 29, 2015
1 parent beefa6b commit e548ca4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down

0 comments on commit e548ca4

Please sign in to comment.