Merge branch 'test.d_iput' into work.misc
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 24 Jul 2016 20:36:04 +0000 (16:36 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 24 Jul 2016 20:36:04 +0000 (16:36 -0400)
1  2 
fs/dcache.c

diff --cc fs/dcache.c
@@@ -569,15 -509,18 +546,13 @@@ static void __dentry_kill(struct dentr
        }
        /* if it was on the hash then remove it */
        __d_drop(dentry);
 -      __list_del_entry(&dentry->d_child);
 -      /*
 -       * Inform d_walk() that we are no longer attached to the
 -       * dentry tree
 -       */
 -      dentry->d_flags |= DCACHE_DENTRY_KILLED;
 +      dentry_unlist(dentry, parent);
        if (parent)
                spin_unlock(&parent->d_lock);
-       dentry_iput(dentry);
-       /*
-        * dentry_iput drops the locks, at which point nobody (except
-        * transient RCU lookups) can reach this dentry.
-        */
-       BUG_ON(dentry->d_lockref.count > 0);
+       if (dentry->d_inode)
+               dentry_unlink_inode(dentry);
+       else
+               spin_unlock(&dentry->d_lock);
        this_cpu_dec(nr_dentry);
        if (dentry->d_op && dentry->d_op->d_release)
                dentry->d_op->d_release(dentry);