Re: [PATCH 20/52] move_mount(2): take sanity checks in 'beneath' case into do_lock_mount()

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

 



On Mon, 25 Aug 2025 at 00:45, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
>                 if (beneath) {
>                         path_put(&under);
>                         read_seqlock_excl(&mount_lock);
> +                       if (unlikely(!mnt_has_parent(m))) {
> +                               read_sequnlock_excl(&mount_lock);
> +                               return -EINVAL;
> +                       }
>                         under.mnt = mntget(&m->mnt_parent->mnt);
>                         under.dentry = dget(m->mnt_mountpoint);
>                         read_sequnlock_excl(&mount_lock);

Well, *this* would look a lot cleaner with a
"scoped_guard(mount_locked_reader)", but you didn't do that for some
reason. Am I missing something?

              Linus




[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