[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 Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux