aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Brauner <[email protected]>2025-06-18 20:53:50 +0000
committerChristian Brauner <[email protected]>2025-06-23 10:22:08 +0000
commitf9fac1f48c20a29f2c39c9a9b96d539ad1636824 (patch)
tree3def5fe12a4ec2c905f11546fa49768851fc73d1
parentselftests/pidfd: test setattr support (diff)
downloadkernel-f9fac1f48c20a29f2c39c9a9b96d539ad1636824.tar.gz
kernel-f9fac1f48c20a29f2c39c9a9b96d539ad1636824.zip
pidfs: add some CONFIG_DEBUG_VFS asserts
Allow to catch some obvious bugs. Link: https://lore.kernel.org/[email protected] Reviewed-by: Alexander Mikhalitsyn <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
-rw-r--r--fs/pidfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/pidfs.c b/fs/pidfs.c
index bde19614ef8b..ba526fdd4c4d 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());