lkml.org 
[lkml]   [2017]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.12 230/235] move the call of __d_drop(anon) into __d_materialise_unique(dentry, anon)
    Date
    From: Al Viro <viro@zeniv.linux.org.uk>

    3.12-stable review patch. If anyone has any objections, please let me know.

    ===============

    commit 6f18493e541c690169c3b1479d47d95f624161cf upstream.

    and lock the right list there

    Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
    Acked-by: NeilBrown <neilb@suse.com>
    Signed-off-by: Jiri Slaby <jslaby@suse.cz>
    ---
    fs/dcache.c | 7 ++++++-
    1 file changed, 6 insertions(+), 1 deletion(-)

    diff --git a/fs/dcache.c b/fs/dcache.c
    index 11ded5b0b853..9a5e9082feb1 100644
    --- a/fs/dcache.c
    +++ b/fs/dcache.c
    @@ -2623,6 +2623,12 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
    dentry->d_parent = dentry;
    list_del_init(&dentry->d_child);
    anon->d_parent = dparent;
    + if (likely(!d_unhashed(anon))) {
    + hlist_bl_lock(&anon->d_sb->s_anon);
    + __hlist_bl_del(&anon->d_hash);
    + anon->d_hash.pprev = NULL;
    + hlist_bl_unlock(&anon->d_sb->s_anon);
    + }
    list_move(&anon->d_child, &dparent->d_subdirs);

    write_seqcount_end(&dentry->d_seq);
    @@ -2677,7 +2683,6 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
    * could splice into our tree? */
    __d_materialise_dentry(dentry, alias);
    write_sequnlock(&rename_lock);
    - __d_drop(alias);
    goto found;
    } else {
    /* Nope, but we must(!) avoid directory
    --
    2.11.0
    \
     
     \ /
      Last update: 2017-01-27 12:21    [W:4.125 / U:0.280 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site