Re: [PATCH 09/10] proc: use path_clone()
From: Jan Kara
Date: Mon Sep 14 2026 - 05:12:06 EST
On Sun 13-09-26 16:49:16, Mateusz Guzik wrote:
> No functional changes.
>
> Signed-off-by: Mateusz Guzik <mjguzik@xxxxxxxxx>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@xxxxxxx>
Honza
> ---
> fs/proc/base.c | 3 +--
> fs/proc/fd.c | 3 +--
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index 01d8bfe1c410..6b055352eabd 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -1766,8 +1766,7 @@ static int proc_exe_link(struct dentry *dentry, struct path *exe_path,
>
> exe_file = get_task_exe_file(task);
> if (exe_file) {
> - *exe_path = exe_file->f_path;
> - path_get(&exe_file->f_path);
> + path_clone(&exe_file->f_path, exe_path);
> fput(exe_file);
> return 0;
> } else
> diff --git a/fs/proc/fd.c b/fs/proc/fd.c
> index 0f9a1556f2a3..9ab9bfd6e48d 100644
> --- a/fs/proc/fd.c
> +++ b/fs/proc/fd.c
> @@ -180,8 +180,7 @@ static int proc_fd_link(struct dentry *dentry, struct path *path,
>
> fd_file = fget_task(task, fd);
> if (fd_file) {
> - *path = fd_file->f_path;
> - path_get(&fd_file->f_path);
> + path_clone(&fd_file->f_path, path);
> ret = 0;
> fput(fd_file);
> }
> --
> 2.53.0
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR