]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
namei.c : update mnt when it needed
authorHuang Shijie <shijie8@gmail.com>
Fri, 2 Apr 2010 09:37:13 +0000 (17:37 +0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 21 May 2010 22:31:22 +0000 (18:31 -0400)
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>
fs/namei.c

index b86b96fe1dc33926eb242a2a2e21061fe46145a5..48e1f60520ea51d64f1802bda2b1d832249e4067 100644 (file)
@@ -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;
 }