From: Christoph Hellwig <hch@lst.de>
To: Kundan Kumar <kundan.kumar@samsung.com>
Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org
Subject: Re: [PATCH 2/2] block: share more code for bio addition helpers
Date: Thu, 7 Nov 2024 08:20:53 +0100 [thread overview]
Message-ID: <20241107072053.GA4112@lst.de> (raw)
In-Reply-To: <20241106100338.35xxy2mcpp4u36xl@green245>
On Wed, Nov 06, 2024 at 03:33:38PM +0530, Kundan Kumar wrote:
>> -int bio_add_page(struct bio *bio, struct page *page,
>> - unsigned int len, unsigned int offset)
>> +static int bio_do_add_page(struct bio *bio, struct page *page,
>> + unsigned int len, unsigned int offset, bool *same_page)
>
> As we are passing length within a folio, values will reach near UINT_MAX.
> It will be better to make len and offset as size_t, also to add a check like :
> if (len > UINT_MAX || offset > UINT_MAX)
> return 0;
Not sure what the point is. IFF we get folio sizes overflowing an
unsigned int we'll have a massive problem as it will overflow the
bv_offset and bv_len fields. So we'd need to address that first before
doing anything else.
>> {
>> - bool same_page = false;
>
> nit: extra line got added
Yes, the previous code was missing the empty line after the variable
declaration, so this got fixed.
next prev parent reply other threads:[~2024-11-07 7:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-05 15:52 bio_add_* cleanups Christoph Hellwig
2024-11-05 15:52 ` [PATCH 1/2] block: remove bio_add_hw_folio Christoph Hellwig
2024-11-06 9:54 ` Kundan Kumar
2024-11-05 15:52 ` [PATCH 2/2] block: share more code for bio addition helpers Christoph Hellwig
2024-11-06 10:03 ` Kundan Kumar
2024-11-07 7:20 ` Christoph Hellwig [this message]
2024-11-07 9:10 ` Kundan Kumar
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=20241107072053.GA4112@lst.de \
--to=hch@lst.de \
--cc=axboe@kernel.dk \
--cc=kundan.kumar@samsung.com \
--cc=linux-block@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.