clean DCACHE_CANT_MOUNT in d_delete()
commitc90680089207aee709b188e00112cd8815056114
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 21 May 2010 20:11:04 +0000 (21 16:11 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 5 Jul 2010 18:22:25 +0000 (5 11:22 -0700)
tree804b2f69d1d7a3c2ea4d520c0c7a5c1e9a4aed9b
parent812dd8968c6804e2b4908318b8936a13e6070208
clean DCACHE_CANT_MOUNT in d_delete()

commit 13e3c5e5b9c67e59074d24e29f3ff794bb4dfef0 upstream.

We set the "it's dead, don't mount on it" flag _and_ do not remove it if
we turn the damn thing negative and leave it around.  And if it goes
positive afterwards, well...

Fortunately, there's only one place where that needs to be caught:
only d_delete() can turn the sucker negative without immediately freeing
it; all other places that can lead to ->d_iput() call are followed by
unconditionally freeing struct dentry in question.  So the fix is obvious:

Addresses https://bugzilla.kernel.org/show_bug.cgi?id=16014
Reported-by: Adam Tkac <vonsch@gmail.com>
Tested-by: Adam Tkac <vonsch@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/dcache.c