lkml.org 
[lkml]   [2018]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 20/35] vfs: don't open real
    Date
    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>
    ---
    fs/open.c | 7 +------
    1 file changed, 1 insertion(+), 6 deletions(-)

    diff --git a/fs/open.c b/fs/open.c
    index d509705d5740..1d1a52908b0f 100644
    --- a/fs/open.c
    +++ b/fs/open.c
    @@ -857,13 +857,8 @@ EXPORT_SYMBOL(file_path);
    int vfs_open(const struct path *path, struct file *file,
    const struct cred *cred)
    {
    - 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, cred);
    + return do_dentry_open(file, d_backing_inode(path->dentry), NULL, cred);
    }

    struct file *path_open(const struct path *path, int flags, struct inode *inode,
    --
    2.14.3
    \
     
     \ /
      Last update: 2018-04-12 17:19    [W:7.078 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site