[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGSQo02-vYG-hkP2VXBVX9Lp8+=gxkyKh7TAYkAYhpiz6gj54w@mail.gmail.com>
Date: Wed, 14 May 2025 15:42:46 -0700
From: Matthew Maurer <mmaurer@...gle.com>
To: Timur Tabi <ttabi@...dia.com>
Cc: "dakr@...nel.org" <dakr@...nel.org>, "tmgross@...ch.edu" <tmgross@...ch.edu>,
"benno.lossin@...ton.me" <benno.lossin@...ton.me>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>, "gary@...yguo.net" <gary@...yguo.net>,
"a.hindborg@...nel.org" <a.hindborg@...nel.org>, "lossin@...nel.org" <lossin@...nel.org>,
"bjorn3_gh@...tonmail.com" <bjorn3_gh@...tonmail.com>, "boqun.feng@...il.com" <boqun.feng@...il.com>,
"rafael@...nel.org" <rafael@...nel.org>, "alex.gaynor@...il.com" <alex.gaynor@...il.com>,
"aliceryhl@...gle.com" <aliceryhl@...gle.com>, "ojeda@...nel.org" <ojeda@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"samitolvanen@...gle.com" <samitolvanen@...gle.com>,
"rust-for-linux@...r.kernel.org" <rust-for-linux@...r.kernel.org>
Subject: Re: [PATCH v5 4/4] rust: samples: Add debugfs sample
On Wed, May 14, 2025 at 3:40 PM Timur Tabi <ttabi@...dia.com> wrote:
>
> On Wed, 2025-05-14 at 15:32 -0700, Matthew Maurer wrote:
> > One further possibility here, which we'd need Greg to weigh in on - we
> > could add a method to the debugfs API intended for Rust usage which
> > specifically releases a directory or file *without* releasing any
> > nested elements. This would mean we could get rid of all the lifetimes
> > on directory and file handles.
>
> I had a conversation with Greg about this topic just the other week.
>
> https://lore.kernel.org/linux-doc/20250429173958.3973958-1-ttabi@nvidia.com/
>
> There are two versions of debugfs_remove:
>
> void debugfs_remove(struct dentry *dentry);
> #define debugfs_remove_recursive debugfs_remove
>
> Unfortunately, the direction that we've been going is to get rid of debugfs_remove_recursive() and
> have drivers only call debugfs_remove().
>
> What would solve your problem is doing the opposite: making debugfs_remove() be non-recursive and
> require drivers to call debugfs_remove_recursive() if that's what they really want.
>
> Maybe we need debugfs_remove_single()?
>
Yes, having access to `debugfs_remove_single()`, if it has the
properties I would expect (namely that the kernel objects for
inaccessible directories continue to exist, they're just not reachable
through the VFS) would allow this design. It's not obvious to me if
it's the design we want, but it would enable that design.
Powered by blists - more mailing lists