namei.c: update mnt when it is needed
PATCH 7/7 namei.c: update mnt when it is needed
From: Huang Shijie <[email protected]>
Update the mnt of the path when it is not equal to the new one.
Signed-off-by Huang Shijie <[email protected]>
Reviewed-by WANG Cong <[email protected]>
Cc Al Viro <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
fs/namei.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/namei.c renamed from fs/namei.c~nameic-update-mnt-when-it-needed +3 -2
@@ -523,9 +523,10 @@ static void path_put_conditional(structstatic 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; }
_