Re: [PATCH v2 03/16] libfs: massage path_from_stashed()

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

 



Am Mi., 18. Juni 2025 um 22:53 Uhr schrieb Christian Brauner
<brauner@xxxxxxxxxx>:
>
> Make it a littler easier to follow.
>
> Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx>

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

> ---
>  fs/libfs.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/fs/libfs.c b/fs/libfs.c
> index 3541e22c87b5..997d3a363ce6 100644
> --- a/fs/libfs.c
> +++ b/fs/libfs.c
> @@ -2227,9 +2227,8 @@ int path_from_stashed(struct dentry **stashed, struct vfsmount *mnt, void *data,
>         if (IS_ERR(res))
>                 return PTR_ERR(res);
>         if (res) {
> -               path->dentry = res;
>                 sops->put_data(data);
> -               goto out_path;
> +               goto make_path;
>         }
>
>         /* Allocate a new dentry. */
> @@ -2246,15 +2245,14 @@ int path_from_stashed(struct dentry **stashed, struct vfsmount *mnt, void *data,
>                 dput(dentry);
>                 return PTR_ERR(res);
>         }
> -       path->dentry = res;
> -       /* A dentry was reused. */
>         if (res != dentry)
>                 dput(dentry);
>
> -out_path:
> -       WARN_ON_ONCE(path->dentry->d_fsdata != stashed);
> -       WARN_ON_ONCE(d_inode(path->dentry)->i_private != data);
> +make_path:
> +       path->dentry = res;
>         path->mnt = mntget(mnt);
> +       VFS_WARN_ON_ONCE(path->dentry->d_fsdata != stashed);
> +       VFS_WARN_ON_ONCE(d_inode(path->dentry)->i_private != data);
>         return 0;
>  }
>
>
> --
> 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