From: Charalampos Mitrodimas <charmitro@posteo.net>
To: "Onur Özkan" <work@onurozkan.dev>
Cc: rust-for-linux@vger.kernel.org, ojeda@kernel.org,
alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net,
bjorn3_gh@protonmail.com, lossin@kernel.org,
a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
dakr@kernel.org, yutaro.ono.418@gmail.com,
borys.tyran@protonmail.com, daniel@sedlak.dev,
tamird@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] rbtree: reduce unsafe blocks on pointer derefs
Date: Mon, 17 Nov 2025 12:13:15 +0000 [thread overview]
Message-ID: <m2jyzo26y1.fsf@posteo.net> (raw)
In-Reply-To: <20251113144547.502-1-work@onurozkan.dev>
Onur Özkan <work@onurozkan.dev> writes:
> Refactors parts of the get() and cursor_lower_bound()
> traversal logic to minimize the scope of unsafe blocks
> and avoid duplicating same safety comments.
>
> One of the removed comments was also misleading:
>
> // SAFETY: `node` is a non-null node...
> Ordering::Equal => return Some(unsafe { &(*this).value }),
>
> as `node` should have been `this`.
>
> No functional changes intended; this is purely a safety
> improvement that reduces the amount of unsafe blocks
> while keeping all invariants intact.
>
> Signed-off-by: Onur Özkan <work@onurozkan.dev>
> ---
> rust/kernel/rbtree.rs | 27 +++++++++++++++------------
> 1 file changed, 15 insertions(+), 12 deletions(-)
>
This is a nice change to have if it reaches the general consensus.
Acked-By: Charalampos Mitrodimas <charmitro@posteo.net>
--
C. Mitrodimas
next prev parent reply other threads:[~2025-11-17 12:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 14:45 [PATCH v1] rbtree: reduce unsafe blocks on pointer derefs Onur Özkan
2025-11-17 12:13 ` Charalampos Mitrodimas [this message]
2026-01-18 21:03 ` Miguel Ojeda
2026-01-19 8:36 ` Charalampos Mitrodimas
2026-01-19 8:39 ` Miguel Ojeda
2026-01-14 8:42 ` Alice Ryhl
2026-01-18 21:02 ` Miguel Ojeda
2026-01-18 21:27 ` Alice Ryhl
2026-01-19 8:21 ` Miguel Ojeda
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=m2jyzo26y1.fsf@posteo.net \
--to=charmitro@posteo.net \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=borys.tyran@protonmail.com \
--cc=dakr@kernel.org \
--cc=daniel@sedlak.dev \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@gmail.com \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
--cc=yutaro.ono.418@gmail.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