On 03.01.24 13:54, Andreas Hindborg (Samsung) wrote: > Wedson Almeida Filho <wedsonaf@xxxxxxxxx> writes: >> + /// Returns the super-block that owns the inode. >> + pub fn super_block(&self) -> &SuperBlock<T> { >> + // SAFETY: `i_sb` is immutable, and `self` is guaranteed to be valid by the existence of a >> + // shared reference (&self) to it. >> + unsafe { &*(*self.0.get()).i_sb.cast() } >> + } > > I think the safety comment should talk about the pointee rather than the > pointer? "The pointee of `i_sb` is immutable, and ..." I think in this case it would be a very good idea to just split the `unsafe` block into two parts. That would solve the issue of "what does this safety comment justify?". -- Cheers, Benno