lkml.org 
[lkml]   [2018]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 139/496] fs: dcache: Use READ_ONCE when accessing i_dir_seq
    Date
    4.14-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Will Deacon <will.deacon@arm.com>

    [ Upstream commit 8cc07c808c9d595e81cbe5aad419b7769eb2e5c9 ]

    i_dir_seq is subject to concurrent modification by a cmpxchg or
    store-release operation, so ensure that the relaxed access in
    d_alloc_parallel uses READ_ONCE.

    Reported-by: Peter Zijlstra <peterz@infradead.org>
    Signed-off-by: Will Deacon <will.deacon@arm.com>
    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    fs/dcache.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/fs/dcache.c
    +++ b/fs/dcache.c
    @@ -2510,7 +2510,7 @@ retry:
    }

    hlist_bl_lock(b);
    - if (unlikely(parent->d_inode->i_dir_seq != seq)) {
    + if (unlikely(READ_ONCE(parent->d_inode->i_dir_seq) != seq)) {
    hlist_bl_unlock(b);
    rcu_read_unlock();
    goto retry;

    \
     
     \ /
      Last update: 2018-05-28 15:27    [W:4.963 / U:1.200 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site