Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

libfs: massage path_from_stashed()

Make it a littler easier to follow.

Link: https://lore.kernel.org/20250618-work-pidfs-persistent-v2-3-98f3456fd552@kernel.org
Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>

+5 -7
+5 -7
fs/libfs.c
··· 2227 2227 if (IS_ERR(res)) 2228 2228 return PTR_ERR(res); 2229 2229 if (res) { 2230 - path->dentry = res; 2231 2230 sops->put_data(data); 2232 - goto out_path; 2231 + goto make_path; 2233 2232 } 2234 2233 2235 2234 /* Allocate a new dentry. */ ··· 2245 2246 dput(dentry); 2246 2247 return PTR_ERR(res); 2247 2248 } 2248 - path->dentry = res; 2249 - /* A dentry was reused. */ 2250 2249 if (res != dentry) 2251 2250 dput(dentry); 2252 2251 2253 - out_path: 2254 - WARN_ON_ONCE(path->dentry->d_fsdata != stashed); 2255 - WARN_ON_ONCE(d_inode(path->dentry)->i_private != data); 2252 + make_path: 2253 + path->dentry = res; 2256 2254 path->mnt = mntget(mnt); 2255 + VFS_WARN_ON_ONCE(path->dentry->d_fsdata != stashed); 2256 + VFS_WARN_ON_ONCE(d_inode(path->dentry)->i_private != data); 2257 2257 return 0; 2258 2258 } 2259 2259