From: Jens Axboe <axboe@kernel.dk>
To: Ammar Faizi <ammarfaizi2@gnuweeb.org>
Cc: Helge Deller <deller@gmx.de>,
io-uring Mailing List <io-uring@vger.kernel.org>,
Linux Parisc Mailing List <linux-parisc@vger.kernel.org>
Subject: Re: [PATCH 5/5] io_uring: add support for user mapped provided buffer ring
Date: Thu, 16 Mar 2023 12:42:49 -0600 [thread overview]
Message-ID: <f9e85ab6-e2cd-f30c-0e46-ab9a312e4219@kernel.dk> (raw)
In-Reply-To: <ZBNa7/tIwEXiQMcQ@biznet-home.integral.gnuweeb.org>
On 3/16/23 12:07 PM, Ammar Faizi wrote:
> I tried to verify the for-next build report. And I think this doesn't
> look right.
>
> On Tue, Mar 14, 2023 at 11:16:42AM -0600, Jens Axboe wrote:
>> @@ -214,15 +215,27 @@ static int __io_remove_buffers(struct io_ring_ctx *ctx,
>> if (!nbufs)
>> return 0;
>>
>> - if (bl->is_mapped && bl->buf_nr_pages) {
>> - int j;
>> -
>> + if (bl->is_mapped) {
>> i = bl->buf_ring->tail - bl->head;
> ^^^^^^^^^^^^^^^^^^
>
> Dereference bl->buf_ring. It implies bl->buf_ring is not NULL.
>
>> - for (j = 0; j < bl->buf_nr_pages; j++)
>> - unpin_user_page(bl->buf_pages[j]);
>> - kvfree(bl->buf_pages);
>> - bl->buf_pages = NULL;
>> - bl->buf_nr_pages = 0;
>> + if (bl->is_mmap) {
>> + if (bl->buf_ring) {
> ^^^^^^^^^^^^^^^^^
>
> A NULL check against bl->buf_ring here. If it was possible to be NULL,
> wouldn't the above dereference BUG()?
I don't think it's possible and we should probably just remove that
latter check. If the buffer group is visible, either method will have
a valid ->buf_ring IFF is_mmap/is_mapped is set.
--
Jens Axboe
prev parent reply other threads:[~2023-03-16 18:42 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230314171641.10542-1-axboe@kernel.dk>
2023-03-15 20:03 ` [PATCHSET 0/5] User mapped provided buffer rings Helge Deller
2023-03-15 20:07 ` Helge Deller
2023-03-15 20:38 ` Jens Axboe
2023-03-15 21:04 ` John David Anglin
2023-03-15 21:08 ` Jens Axboe
2023-03-15 21:18 ` Jens Axboe
2023-03-16 10:18 ` Helge Deller
2023-03-16 17:00 ` Jens Axboe
2023-03-16 19:08 ` John David Anglin
2023-03-16 19:46 ` Jens Axboe
2023-03-17 2:09 ` Jens Axboe
2023-03-17 2:17 ` Jens Axboe
2023-03-17 15:36 ` John David Anglin
2023-03-17 15:57 ` Jens Axboe
2023-03-17 16:15 ` John David Anglin
2023-03-17 16:37 ` Jens Axboe
2023-03-15 20:11 ` Jens Axboe
[not found] ` <20230314171641.10542-6-axboe@kernel.dk>
2023-03-16 18:07 ` [PATCH 5/5] io_uring: add support for user mapped provided buffer ring Ammar Faizi
2023-03-16 18:42 ` Jens Axboe [this message]
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=f9e85ab6-e2cd-f30c-0e46-ab9a312e4219@kernel.dk \
--to=axboe@kernel.dk \
--cc=ammarfaizi2@gnuweeb.org \
--cc=deller@gmx.de \
--cc=io-uring@vger.kernel.org \
--cc=linux-parisc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox