lkml.org 
[lkml]   [2020]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.4 076/123] gfs2_atomic_open(): fix O_EXCL|O_CREAT handling on cold dcache
    Date
    From: Al Viro <viro@zeniv.linux.org.uk>

    commit 21039132650281de06a169cbe8a0f7e5c578fd8b upstream.

    with the way fs/namei.c:do_last() had been done, ->atomic_open()
    instances needed to recognize the case when existing file got
    found with O_EXCL|O_CREAT, either by falling back to finish_no_open()
    or failing themselves. gfs2 one didn't.

    Fixes: 6d4ade986f9c (GFS2: Add atomic_open support)
    Cc: stable@kernel.org # v3.11
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    fs/gfs2/inode.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/fs/gfs2/inode.c
    +++ b/fs/gfs2/inode.c
    @@ -1248,7 +1248,7 @@ static int gfs2_atomic_open(struct inode
    if (!(file->f_mode & FMODE_OPENED))
    return finish_no_open(file, d);
    dput(d);
    - return 0;
    + return excl && (flags & O_CREAT) ? -EEXIST : 0;
    }

    BUG_ON(d != NULL);

    \
     
     \ /
      Last update: 2020-03-17 12:06    [W:4.034 / U:0.916 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site