Skip to content

Commit

Permalink
namei.c : update mnt when it needed
Browse files Browse the repository at this point in the history
update the mnt of the path when it is not equal to the new one.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Huang Shijie authored and Al Viro committed May 21, 2010
1 parent 51ee049 commit 9a22968
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9a22968

Please sign in to comment.