[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AT5PR8401MB11694BE736D8E344C94C2FFCAB340@AT5PR8401MB1169.NAMPRD84.PROD.OUTLOOK.COM>
Date: Thu, 2 May 2019 21:51:44 +0000
From: "Elliott, Robert (Servers)" <elliott@....com>
To: Marcos Paulo de Souza <marcos.souza.org@...il.com>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>
CC: Jens Axboe <axboe@...nel.dk>, Hannes Reinecke <hare@...e.com>,
"Omar Sandoval" <osandov@...com>, Ming Lei <ming.lei@...hat.com>,
Damien Le Moal <damien.lemoal@....com>,
Bart Van Assche <bvanassche@....org>,
Greg Edwards <gedwards@....com>,
open list <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/2] blkdev.h: Introduce size_to_sectors hlper function
> -----Original Message-----
> From: linux-kernel-owner@...r.kernel.org [mailto:linux-kernel-owner@...r.kernel.org] On Behalf Of
> Marcos Paulo de Souza
> Sent: Monday, April 29, 2019 8:32 PM
> Subject: [PATCH 1/2] blkdev.h: Introduce size_to_sectors hlper function
>
> This function takes an argument to specify the size of a block device,
> in bytes, and return the number of sectors of 512 bytes.
>
...
> +static inline sector_t size_to_sectors(long long size)
> +{
> + return size >> SECTOR_SHIFT;
> +}
At least one of the users in PATCH 2/2 passes an unsigned value that won't
fit in a signed argument:
- blk_queue_max_discard_sectors(nullb->q, UINT_MAX >> 9);
+ blk_queue_max_discard_sectors(nullb->q, size_to_sectors(UINT_MAX));
Powered by blists - more mailing lists