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
index 484a52db99babf18fb358411738190b66fa15dd1,fe7cde2f2fe52428112d8e4b09c5952584ebca50..d5beef01cdfc25ab190e399b7827d8dec99179ad
@@@ -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);