Re: [PATCH 1/2] rust: file: mark `LocalFile` as `repr(transparent)`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday, May 28th, 2025 at 13.52, Miguel Ojeda <miguel.ojeda.sandonis@xxxxxxxxx> wrote:

> On Tue, May 27, 2025 at 10:49 PM Pekka Ristola <pekkarr@xxxxxxxxxxxxxx> wrote:
> 
> > Unsafe code in `LocalFile`'s methods assumes that the type has the same
> > layout as the inner `bindings::file`. This is not guaranteed by the default
> > struct representation in Rust, but requires specifying the `transparent`
> > representation.
> > 
> > The `File` struct (which also wraps `bindings::file`) is already marked as
> > `repr(transparent)`, so this change makes their layouts equivalent.
> > 
> > Fixes: 851849824bb5 ("rust: file: add Rust abstraction for `struct file`")
> > Closes: https://github.com/Rust-for-Linux/linux/issues/1165
> > Signed-off-by: Pekka Ristola pekkarr@xxxxxxxxxxxxxx
> 
> 
> Thanks Pekka, both patches look good to me. I will close the issue
> when Christian applies them (or if I should take them, that is good
> too).

Thanks, I'm glad it went smoothly since this was my first patch to the
mailing list.

Pekka





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux