Skip to content

Commit e548ca4

Browse files
committed
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 <axboe@fb.com>
1 parent beefa6b commit e548ca4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/blkdev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq)
903903
if (unlikely(rq->cmd_type == REQ_TYPE_BLOCK_PC))
904904
return q->limits.max_hw_sectors;
905905

906-
if (!q->limits.chunk_sectors)
906+
if (!q->limits.chunk_sectors || (rq->cmd_flags & REQ_DISCARD))
907907
return blk_queue_get_max_sectors(q, rq->cmd_flags);
908908

909909
return min(blk_max_size_offset(q, blk_rq_pos(rq)),

0 commit comments

Comments
 (0)