Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -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)
static inline void path_to_nameidata(struct path *path, struct nameidata *nd)
{
{
	dput(nd->path.dentry);
	dput(nd->path.dentry);
	if (nd->path.mnt != path->mnt)
	if (nd->path.mnt != path->mnt) {
		mntput(nd->path.mnt);
		mntput(nd->path.mnt);
		nd->path.mnt = path->mnt;
		nd->path.mnt = path->mnt;
	}
	nd->path.dentry = path->dentry;
	nd->path.dentry = path->dentry;
}
}