summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro2013-11-29 07:48:32 +0100
committerAl Viro2013-11-29 07:50:51 +0100
commitd870b4a191a389c661cd40aacb06981c26b5e504 (patch)
tree1518f3a778b105f737b3ba8453ec557ac8234f6d /fs
parentMerge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86 (diff)
downloadkernel-qcow2-linux-d870b4a191a389c661cd40aacb06981c26b5e504.tar.gz
kernel-qcow2-linux-d870b4a191a389c661cd40aacb06981c26b5e504.tar.xz
kernel-qcow2-linux-d870b4a191a389c661cd40aacb06981c26b5e504.zip
fix bogus path_put() of nd->root after some unlazy_walk() failures
Failure to grab reference to parent dentry should go through the same cleanup as nd->seq mismatch. As it is, we might end up with caller thinking it needs to path_put() nd->root, with obvious nasty results once we'd hit that bug enough times to drive the refcount of root dentry all the way to zero... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 8f77a8cea289..c53d3a9547f9 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -513,8 +513,7 @@ static int unlazy_walk(struct nameidata *nd, struct dentry *dentry)
if (!lockref_get_not_dead(&parent->d_lockref)) {
nd->path.dentry = NULL;
- rcu_read_unlock();
- return -ECHILD;
+ goto out;
}
/*