summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2023-06-15 13:22:28 +0200
committerChristian Brauner <brauner@kernel.org>2023-06-19 18:16:38 +0200
commit62d53c4a1dfe347bd87ede46ffad38c9a3870338 (patch)
tree50bf37201de8a425c8e4cc23b1be69bde2e4b6eb /fs/overlayfs
parentfs: move kmem_cache_zalloc() into alloc_empty_file*() helpers (diff)
downloadlinux-62d53c4a1dfe347bd87ede46ffad38c9a3870338.tar.xz
linux-62d53c4a1dfe347bd87ede46ffad38c9a3870338.zip
fs: use backing_file container for internal files with "fake" f_path
Overlayfs uses open_with_fake_path() to allocate internal kernel files, with a "fake" path - whose f_path is not on the same fs as f_inode. Allocate a container struct backing_file for those internal files, that is used to hold the "fake" ovl path along with the real path. backing_file_real_path() can be used to access the stored real path. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Message-Id: <20230615112229.2143178-5-amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r--fs/overlayfs/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c
index 7c04f033aadd..71fa6c83f093 100644
--- a/fs/overlayfs/file.c
+++ b/fs/overlayfs/file.c
@@ -61,8 +61,8 @@ static struct file *ovl_open_realfile(const struct file *file,
if (!inode_owner_or_capable(real_idmap, realinode))
flags &= ~O_NOATIME;
- realfile = open_with_fake_path(&file->f_path, flags, realinode,
- current_cred());
+ realfile = backing_file_open(&file->f_path, flags, realpath,
+ current_cred());
}
revert_creds(old_cred);