Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18f922d0 authored by Alan's avatar Alan Committed by Jens Axboe
Browse files

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: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 3d65ae46
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -147,10 +147,9 @@ static ssize_t queue_discard_granularity_show(struct request_queue *q, char *pag

static ssize_t queue_discard_max_hw_show(struct request_queue *q, char *page)
{
	unsigned long long val;

	val = q->limits.max_hw_discard_sectors << 9;
	return sprintf(page, "%llu\n", val);
	return sprintf(page, "%llu\n",
		(unsigned long long)q->limits.max_hw_discard_sectors << 9);
}

static ssize_t queue_discard_max_show(struct request_queue *q, char *page)