From: Al Viro <viro@zeniv.linux.org.uk>
Date: Sun, 24 Jul 2016 20:36:04 +0000 (-0400)
Subject: Merge branch 'test.d_iput' into work.misc
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=17648b871d3cecf310f55ce8c6ce5821d135f6ec;p=linux.git

Merge branch 'test.d_iput' into work.misc
---

17648b871d3cecf310f55ce8c6ce5821d135f6ec
diff --cc fs/dcache.c
index 484a52db99bab,fe7cde2f2fe52..d5beef01cdfc2
--- a/fs/dcache.c
+++ b/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);