diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-05-21 20:11:04 (GMT) |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-05-21 22:31:12 (GMT) |
commit | 13e3c5e5b9c67e59074d24e29f3ff794bb4dfef0 (patch) | |
tree | 18222526565a7fdf44aba30d2861c1f6b75516e3 /fs | |
parent | d515e86e639890b33a09390d062b0831664f04a2 (diff) | |
download | linux-13e3c5e5b9c67e59074d24e29f3ff794bb4dfef0.tar.xz |
clean DCACHE_CANT_MOUNT in d_delete()
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>
Cc: <stable@kernel.org> [2.6.34.x]
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/dcache.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index f1358e5..2b6f09af 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1529,6 +1529,7 @@ void d_delete(struct dentry * dentry) spin_lock(&dentry->d_lock); isdir = S_ISDIR(dentry->d_inode->i_mode); if (atomic_read(&dentry->d_count) == 1) { + dentry->d_flags &= ~DCACHE_CANT_MOUNT; dentry_iput(dentry); fsnotify_nameremove(dentry, isdir); return; |