Re: [PATCH 04/10] fs: use path_clone() and path_move() in vfs_open*

From: Jan Kara

Date: Mon Sep 14 2026 - 05:13:25 EST


On Sun 13-09-26 16:49:11, 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/open.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/fs/open.c b/fs/open.c
> index a84b55301719..e11d1342ff74 100644
> --- a/fs/open.c
> +++ b/fs/open.c
> @@ -1102,8 +1102,7 @@ int vfs_open(const struct path *path, struct file *file)
> {
> int ret;
>
> - file->__f_path = *path;
> - path_get(&file->f_path);
> + path_clone(path, &file->__f_path);
> ret = do_dentry_open(file, NULL);
> if (!ret) {
> /*
> @@ -1125,9 +1124,7 @@ int vfs_open_consume(struct path *path, struct file *file)
> {
> int ret;
>
> - file->__f_path = *path;
> - path->mnt = NULL;
> - path->dentry = NULL;
> + path_move(path, &file->__f_path);
> ret = do_dentry_open(file, NULL);
> if (!ret) {
> fsnotify_open(file);
> --
> 2.53.0
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR