[PATCH 3/3] fs: store fake path in file_fake along with real path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instead of storing only the fake path in f_path, store the real path
in f_path and the fake path in file_fake container.

Call sites that use the macro file_fake_path() continue to get the fake
path from its new location.

Call sites that access f_path directly will now see the overlayfs real
path instead of the fake overlayfs path, which is the desired bahvior
for most users, because it makes f_path consistent with f_inode.

Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
---
 fs/open.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/open.c b/fs/open.c
index c9e2300a037d..4f4e7534f515 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -1120,11 +1120,11 @@ struct file *open_with_fake_path(const struct path *fake_path, int flags,
 				 const struct path *path,
 				 const struct cred *cred)
 {
-	struct file *f = alloc_empty_file_fake(NULL, flags, cred);
+	struct file *f = alloc_empty_file_fake(fake_path, flags, cred);
 	if (!IS_ERR(f)) {
 		int error;
 
-		f->f_path = *fake_path;
+		f->f_path = *path;
 		error = do_dentry_open(f, d_inode(path->dentry), NULL);
 		if (error) {
 			fput(f);
-- 
2.34.1




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux