summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@redhat.com>2018-07-06 23:57:06 +0200
committerMiklos Szeredi <mszeredi@redhat.com>2018-07-18 15:44:42 +0200
commita6518f73e60e5044656d1ba587e7463479a9381a (patch)
treeb7105c1ee7e5abffba3d450d2df6c157f806d1aa
parent8ede205541ff05bd096749a9f00bde6d754b4e22 (diff)
downloadlwn-a6518f73e60e5044656d1ba587e7463479a9381a.tar.gz
lwn-a6518f73e60e5044656d1ba587e7463479a9381a.zip
vfs: don't open real
Let overlayfs do its thing when opening a file. This enables stacking and fixes the corner case when a file is opened for read, modified through a writable open, and data is read from the read-only file. After this patch the read-only open will not return stale data even in this case. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/open.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/open.c b/fs/open.c
index 9c6617dbb2c0..fed24862ef83 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -893,13 +893,8 @@ EXPORT_SYMBOL(file_path);
*/
int vfs_open(const struct path *path, struct file *file)
{
- struct dentry *dentry = d_real(path->dentry, NULL, file->f_flags, 0);
-
- if (IS_ERR(dentry))
- return PTR_ERR(dentry);
-
file->f_path = *path;
- return do_dentry_open(file, d_backing_inode(dentry), NULL);
+ return do_dentry_open(file, d_backing_inode(path->dentry), NULL);
}
struct file *dentry_open(const struct path *path, int flags,