From: "Elliott, Robert (Servers)" <elliott@hpe.com>
To: Marcos Paulo de Souza <marcos.souza.org@gmail.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>, Hannes Reinecke <hare@suse.com>,
"Omar Sandoval" <osandov@fb.com>, Ming Lei <ming.lei@redhat.com>,
Damien Le Moal <damien.lemoal@wdc.com>,
Bart Van Assche <bvanassche@acm.org>,
Greg Edwards <gedwards@ddn.com>,
open list <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 1/2] blkdev.h: Introduce size_to_sectors hlper function
Date: Thu, 2 May 2019 21:51:44 +0000 [thread overview]
Message-ID: <AT5PR8401MB11694BE736D8E344C94C2FFCAB340@AT5PR8401MB1169.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20190430013205.1561708-2-marcos.souza.org@gmail.com>
> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-owner@vger.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));
next prev parent reply other threads:[~2019-05-02 21:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20190430013205.1561708-1-marcos.souza.org@gmail.com>
2019-04-30 1:32 ` Marcos Paulo de Souza
2019-04-30 2:50 ` Martin K. Petersen
2019-04-30 10:52 ` Marcos Paulo de Souza
2019-05-02 21:51 ` Elliott, Robert (Servers) [this message]
2019-04-30 1:32 ` [PATCH 2/2] null_blk: Make use of size_to_sectors helper Marcos Paulo de Souza
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AT5PR8401MB11694BE736D8E344C94C2FFCAB340@AT5PR8401MB1169.NAMPRD84.PROD.OUTLOOK.COM \
--to=elliott@hpe.com \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=damien.lemoal@wdc.com \
--cc=gedwards@ddn.com \
--cc=hare@suse.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcos.souza.org@gmail.com \
--cc=ming.lei@redhat.com \
--cc=osandov@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®