diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blkdev.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 89d89c7162aa..6189bf26b53d 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -844,7 +844,7 @@ static inline unsigned int blk_queue_get_max_sectors(struct request_queue *q, | |||
844 | unsigned int cmd_flags) | 844 | unsigned int cmd_flags) |
845 | { | 845 | { |
846 | if (unlikely(cmd_flags & REQ_DISCARD)) | 846 | if (unlikely(cmd_flags & REQ_DISCARD)) |
847 | return q->limits.max_discard_sectors; | 847 | return min(q->limits.max_discard_sectors, UINT_MAX >> 9); |
848 | 848 | ||
849 | if (unlikely(cmd_flags & REQ_WRITE_SAME)) | 849 | if (unlikely(cmd_flags & REQ_WRITE_SAME)) |
850 | return q->limits.max_write_same_sectors; | 850 | return q->limits.max_write_same_sectors; |