mirror of
https://github.com/torvalds/linux.git
synced 2024-12-27 21:33:00 +00:00
vfs - fix dentry ref count in do_lookup()
There is a ref count problem in fs/namei.c:do_lookup(). When walking in ref-walk mode, if follow_managed() returns a fail we need to drop dentry and possibly vfsmount. Clean up properly, as we do in the other caller of follow_managed(). Signed-off-by: Ian Kent <raven@themaw.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
c14cc63a63
commit
8931221411
@ -1272,8 +1272,10 @@ done:
|
||||
path->mnt = mnt;
|
||||
path->dentry = dentry;
|
||||
err = follow_managed(path, nd->flags);
|
||||
if (unlikely(err < 0))
|
||||
if (unlikely(err < 0)) {
|
||||
path_put_conditional(path, nd);
|
||||
return err;
|
||||
}
|
||||
*inode = path->dentry->d_inode;
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user