[093/200] clean DCACHE_CANT_MOUNT in d_delete()
diff mbox series

Message ID 20100701174254.267009471@clark.site
State New, archived
Headers show
  • stable review
Related show

Commit Message

Greg KH July 1, 2010, 5:43 p.m. UTC
2.6.34-stable review patch.  If anyone has any objections, please let me know.


From: Al Viro <viro@zeniv.linux.org.uk>

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 |    1 +
 1 file changed, 1 insertion(+)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

diff mbox series

--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1529,6 +1529,7 @@  void d_delete(struct dentry * dentry)
 	isdir = S_ISDIR(dentry->d_inode->i_mode);
 	if (atomic_read(&dentry->d_count) == 1) {
+		dentry->d_flags &= ~DCACHE_CANT_MOUNT;
 		fsnotify_nameremove(dentry, isdir);