Re: [PATCH v2 16/16] pidfs: add some CONFIG_DEBUG_VFS asserts

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

 



Am Mi., 18. Juni 2025 um 22:54 Uhr schrieb Christian Brauner
<brauner@xxxxxxxxxx>:
>
> Allow to catch some obvious bugs.
>
> Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>

Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@xxxxxxxxxxxxx>

> ---
>  fs/pidfs.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/fs/pidfs.c b/fs/pidfs.c
> index 15d99854d243..1cf66fd9961e 100644
> --- a/fs/pidfs.c
> +++ b/fs/pidfs.c
> @@ -809,6 +809,8 @@ static struct dentry *pidfs_fh_to_dentry(struct super_block *sb,
>         if (ret < 0)
>                 return ERR_PTR(ret);
>
> +       VFS_WARN_ON_ONCE(!pid->attr);
> +
>         mntput(path.mnt);
>         return path.dentry;
>  }
> @@ -1038,6 +1040,8 @@ struct file *pidfs_alloc_file(struct pid *pid, unsigned int flags)
>         if (ret < 0)
>                 return ERR_PTR(ret);
>
> +       VFS_WARN_ON_ONCE(!pid->attr);
> +
>         flags &= ~PIDFD_STALE;
>         flags |= O_RDWR;
>         pidfd_file = dentry_open(&path, flags, current_cred());
>
> --
> 2.47.2
>




[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