linux/fs/overlayfs
Amir Goldstein def3ae83da
fs: store real path instead of fake path in backing file f_path
A backing file struct stores two path's, one "real" path that is referring
to f_inode and one "fake" path, which should be displayed to users in
/proc/<pid>/maps.

There is a lot more potential code that needs to know the "real" path, then
code that needs to know the "fake" path.

Instead of code having to request the "real" path with file_real_path(),
store the "real" path in f_path and require code that needs to know the
"fake" path request it with file_user_path().
Replace the file_real_path() helper with a simple const accessor f_path().

After this change, file_dentry() is not expected to observe any files
with overlayfs f_path and real f_inode, so the call to ->d_real() should
not be needed.  Leave the ->d_real() call for now and add an assertion
in ovl_d_real() to catch if we made wrong assumptions.

Suggested-by: Miklos Szeredi <miklos@szeredi.hu>
Link: https://lore.kernel.org/r/CAJfpegtt48eXhhjDFA1ojcHPNKj3Go6joryCPtEFAKpocyBsnw@mail.gmail.com/
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20231009153712.1566422-4-amir73il@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
2023-10-19 11:03:15 +02:00
..
copy_up.c ovl: make consistent use of OVL_FS() 2023-08-12 19:02:54 +03:00
dir.c ovl: store enum redirect_mode in config instead of a string 2023-06-19 14:02:01 +03:00
export.c ovl: make consistent use of OVL_FS() 2023-08-12 19:02:54 +03:00
file.c overlayfs update for 6.6 2023-08-30 11:54:09 -07:00
inode.c overlayfs update for 6.6 2023-08-30 11:54:09 -07:00
Kconfig ovl: Kconfig: introduce CONFIG_OVERLAY_FS_DEBUG 2023-08-12 19:02:53 +03:00
Makefile ovl: modify layer parameter parsing 2023-06-20 14:10:40 +03:00
namei.c ovl: make consistent use of OVL_FS() 2023-08-12 19:02:54 +03:00
overlayfs.h overlayfs update for 6.6 2023-08-30 11:54:09 -07:00
ovl_entry.h ovl: validate superblock in OVL_FS() 2023-08-12 19:02:54 +03:00
params.c ovl: make consistent use of OVL_FS() 2023-08-12 19:02:54 +03:00
params.h ovl: move all parameter handling into params.{c,h} 2023-07-03 16:08:17 +03:00
readdir.c vfs: get rid of old '->iterate' directory operation 2023-08-06 15:08:35 +02:00
super.c fs: store real path instead of fake path in backing file f_path 2023-10-19 11:03:15 +02:00
util.c overlayfs update for 6.6 2023-08-30 11:54:09 -07:00