Re: [PATCH] get rid of dead code in legitimize_root()

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

 



On Fri, May 20, 2022 at 03:18:32AM +0000, Al Viro wrote:
> Combination of LOOKUP_IS_SCOPED and NULL nd->root.mnt is impossible
> after successful path_init().  All places where ->root.mnt might
> become NULL do that only if LOOKUP_IS_SCOPED is not there and
> path_init() itself can return success without setting nd->root
> only if ND_ROOT_PRESET had been set (in which case nd->root
> had been set by caller and never changed) or if the name had
> been a relative one *and* none of the bits in LOOKUP_IS_SCOPED
> had been present.
> 
> Since all calls of legitimize_root() must be downstream of successful
> path_init(), the check for !nd->root.mnt && (nd->flags & LOOKUP_IS_SCOPED)
> is pure paranoia.
> 
> FWIW, it had been discussed (and agreed upon) with Aleksa back when
> scoped lookups had been merged; looks like that had fallen through the
> cracks back then.
> 
> Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> ---

Looks good to me,
Reviewed-by: Christian Brauner (Microsoft) <brauner@xxxxxxxxxx>



[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