Re: [PATCH 01/10] fs: unexport backing_file_set_user_path() and make it take the ref on its own
From: Jan Kara
Date: Mon Sep 14 2026 - 04:45:36 EST
On Sun 13-09-26 16:49:08, Mateusz Guzik wrote:
> Prep for path_* API changes, which will force the ref change.
>
> There are likely no users outside of the tree, but should there be some they
> will no longer be caught by surprise.
>
> Signed-off-by: Mateusz Guzik <mjguzik@xxxxxxxxx>
Nice cleanup. Feel free to add:
Reviewed-by: Jan Kara <jack@xxxxxxx>
Honza
> ---
> fs/backing-file.c | 2 --
> fs/file_table.c | 2 +-
> 2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/fs/backing-file.c b/fs/backing-file.c
> index cc101143f921..e92410a27982 100644
> --- a/fs/backing-file.c
> +++ b/fs/backing-file.c
> @@ -43,7 +43,6 @@ struct file *backing_file_open(const struct file *user_file, int flags,
> if (IS_ERR(f))
> return f;
>
> - path_get(user_path);
> backing_file_set_user_path(f, user_path);
> error = vfs_open(real_path, f);
> if (error) {
> @@ -68,7 +67,6 @@ struct file *backing_tmpfile_open(const struct file *user_file, int flags,
> if (IS_ERR(f))
> return f;
>
> - path_get(user_path);
> backing_file_set_user_path(f, user_path);
> error = vfs_tmpfile(real_idmap, real_parentpath, f, mode);
> if (error) {
> diff --git a/fs/file_table.c b/fs/file_table.c
> index 8dcd213c0251..f9d1b5edd6ae 100644
> --- a/fs/file_table.c
> +++ b/fs/file_table.c
> @@ -71,8 +71,8 @@ EXPORT_SYMBOL_GPL(backing_file_user_path);
> void backing_file_set_user_path(struct file *f, const struct path *path)
> {
> backing_file(f)->user_path = *path;
> + path_get(path);
> }
> -EXPORT_SYMBOL_GPL(backing_file_set_user_path);
>
> #ifdef CONFIG_SECURITY
> void *backing_file_security(const struct file *f)
> --
> 2.53.0
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR