Re: [PATCH v2 1/2] rust: debugfs: avoid borrowing seq_file in write
From: Matthew Maurer
Date: Tue May 26 2026 - 15:29:15 EST
On Tue, May 26, 2026 at 11:08 AM Tamir Duberstein <tamird@xxxxxxxxxx> wrote:
>
> Commit 40ecc49466c8 ("rust: debugfs: Add support for callback-based
> files") introduced `write()`, which creates a mutable Rust reference to
> the `seq_file` stored in `file->private_data`.
>
> File operation callbacks may execute concurrently for the same open
> file. Creating that reference assumes exclusive access to the
> `seq_file`, so overlapping calls can create aliased mutable references,
> which violates Rust aliasing rules [1].
Thanks, I inaccurately assumed that the DebugFS wrapper would
serialize file operations relative to each other.
Reviewed-by: Matthew Maurer <mmaurer@xxxxxxxxxx>