public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Hindborg <a.hindborg@kernel.org>
To: "Tamir Duberstein" <tamird@gmail.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Joel Becker" <jlbec@evilplan.org>,
	"Christoph Hellwig" <hch@lst.de>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Ingo Molnar" <mingo@redhat.com>, "Will Deacon" <will@kernel.org>,
	"Waiman Long" <longman@redhat.com>,
	"Fiona Behrens" <me@kloenk.dev>,
	"Charalampos Mitrodimas" <charmitro@posteo.net>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/3] rust: sync: change `<Arc<T> as ForeignOwnable>::PointedTo` to `T`
Date: Mon, 17 Feb 2025 08:34:43 +0100	[thread overview]
Message-ID: <87y0y5t46k.fsf@kernel.org> (raw)
In-Reply-To: <CAJ-ks9mDNptodHEPPd+TPZGT1Cs9EtyUKa9+ciAK9c4pge9M2A@mail.gmail.com> (Tamir Duberstein's message of "Sun, 16 Feb 2025 21:03:58 -0500")

"Tamir Duberstein" <tamird@gmail.com> writes:

> On Fri, Feb 7, 2025 at 9:50 AM Andreas Hindborg <a.hindborg@kernel.org> wrote:
>>
>> Using `ArcInner` as `PoinedTo` in the `ForeignOwnable` implementation for
>> `Arc` is a bit unfortunate. Using `T` as `PointedTo` does not remove any
>> functionality, but allows `ArcInner` to be private. Further, it allows
>> downstream users to write code that is generic over `Box` and `Arc`, when
>> downstream users need access to `T` after calling `into_foreign`.
>
> I stumbled upon https://github.com/Rust-for-Linux/linux/pull/1036 the
> other day. Boqun, are there any plans to revive this work? It might
> obviate the need for _this_ patch.

I don't think it would help configfs. The configfs patches rely on
getting access to a `T` pointer from `ForeignOwnable::into_foreign`.

In fact, thinking about this, I should probably mandate this in
`ForeignOwnable` API requirements in order to not have soundness hinge
on the implementation of `ForeignOwnable`.

Also I would appreciate that if we want to use a reference to `ArcInner`
rather than a special borrow type, maybe let's do it down the line and
not stall this series on that work.


Best regards,
Andreas Hindborg




  reply	other threads:[~2025-02-17 11:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-07 14:41 [PATCH v2 0/3] rust: configfs abstractions Andreas Hindborg
2025-02-07 14:41 ` [PATCH v2 1/3] rust: sync: change `<Arc<T> as ForeignOwnable>::PointedTo` to `T` Andreas Hindborg
2025-02-17  0:21   ` Benno Lossin
2025-02-17  2:03   ` Tamir Duberstein
2025-02-17  7:34     ` Andreas Hindborg [this message]
2025-02-07 14:41 ` [PATCH v2 2/3] rust: configfs: introduce rust support for configfs Andreas Hindborg
2025-02-08 21:26   ` Charalampos Mitrodimas
2025-02-10 10:36     ` Andreas Hindborg
2025-02-16 16:12   ` Charalampos Mitrodimas
2025-02-17  7:36     ` Andreas Hindborg
2025-02-17  2:17   ` Benno Lossin
2025-02-17 11:08     ` Andreas Hindborg
2025-02-17 11:40       ` Benno Lossin
2025-02-17 12:20         ` Andreas Hindborg
2025-02-17 23:04           ` Benno Lossin
2025-02-18  8:40             ` Andreas Hindborg
2025-02-18 12:17           ` Andreas Hindborg
2025-02-18 12:41             ` Benno Lossin
2025-02-18 13:00       ` Danilo Krummrich
2025-02-18 13:10         ` Andreas Hindborg
2025-02-07 14:41 ` [PATCH v2 3/3] MAINTAINERS: add entry for configfs Rust abstractions Andreas Hindborg

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=87y0y5t46k.fsf@kernel.org \
    --to=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=charmitro@posteo.net \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=hch@lst.de \
    --cc=jlbec@evilplan.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=me@kloenk.dev \
    --cc=mingo@redhat.com \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@gmail.com \
    --cc=tmgross@umich.edu \
    --cc=will@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