Commit 9a229683 authored by Huang Shijie's avatar Huang Shijie Committed by Al Viro

namei.c : update mnt when it needed

update the mnt of the path when it is not equal to the new one.
Signed-off-by: default avatarHuang Shijie <shijie8@gmail.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 51ee049e
......@@ -523,9 +523,10 @@ static void path_put_conditional(struct path *path, struct nameidata *nd)
static inline void path_to_nameidata(struct path *path, struct nameidata *nd)
{
dput(nd->path.dentry);
if (nd->path.mnt != path->mnt)
if (nd->path.mnt != path->mnt) {
mntput(nd->path.mnt);
nd->path.mnt = path->mnt;
nd->path.mnt = path->mnt;
}
nd->path.dentry = path->dentry;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment