diff options
| author | Alan <gnomes@lxorguk.ukuu.org.uk> | 2016-02-17 09:15:30 -0500 |
|---|---|---|
| committer | Jens Axboe <axboe@fb.com> | 2016-02-17 12:20:42 -0500 |
| commit | 18f922d037211a15543af935861bf92161e697e9 (patch) | |
| tree | 99fe77119a941ad307706095915b99bb3325fadb | |
| parent | 3d65ae4634ed8350aee98a4e6f4e41fe40c7d282 (diff) | |
blk: fix overflow in queue_discard_max_hw_show
We get this right for queue_discard_max_show but not max_hw_show. Follow the
same pattern as queue_discard_max_show instead so that we don't truncate.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
| -rw-r--r-- | block/blk-sysfs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index e140cc487ce1..dd93763057ce 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c | |||
| @@ -147,10 +147,9 @@ static ssize_t queue_discard_granularity_show(struct request_queue *q, char *pag | |||
| 147 | 147 | ||
| 148 | static ssize_t queue_discard_max_hw_show(struct request_queue *q, char *page) | 148 | static ssize_t queue_discard_max_hw_show(struct request_queue *q, char *page) |
| 149 | { | 149 | { |
| 150 | unsigned long long val; | ||
| 151 | 150 | ||
| 152 | val = q->limits.max_hw_discard_sectors << 9; | 151 | return sprintf(page, "%llu\n", |
| 153 | return sprintf(page, "%llu\n", val); | 152 | (unsigned long long)q->limits.max_hw_discard_sectors << 9); |
| 154 | } | 153 | } |
| 155 | 154 | ||
| 156 | static ssize_t queue_discard_max_show(struct request_queue *q, char *page) | 155 | static ssize_t queue_discard_max_show(struct request_queue *q, char *page) |
