Commit 5b857119538daac7118c1364d7ff3613f12b84d3
1 parent
2a73787110
Exists in
master
and in
7 other branches
Make vfs_path_lookup() use starting point as root
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 1 changed file with 4 additions and 5 deletions Side-by-side Diff
fs/namei.c
... | ... | @@ -1123,21 +1123,20 @@ |
1123 | 1123 | nd->last_type = LAST_ROOT; |
1124 | 1124 | nd->flags = flags; |
1125 | 1125 | nd->depth = 0; |
1126 | - nd->root.mnt = NULL; | |
1127 | 1126 | |
1128 | 1127 | nd->path.dentry = dentry; |
1129 | 1128 | nd->path.mnt = mnt; |
1130 | 1129 | path_get(&nd->path); |
1130 | + nd->root = nd->path; | |
1131 | + path_get(&nd->root); | |
1131 | 1132 | |
1132 | 1133 | retval = path_walk(name, nd); |
1133 | 1134 | if (unlikely(!retval && !audit_dummy_context() && nd->path.dentry && |
1134 | 1135 | nd->path.dentry->d_inode)) |
1135 | 1136 | audit_inode(name, nd->path.dentry); |
1136 | 1137 | |
1137 | - if (nd->root.mnt) { | |
1138 | - path_put(&nd->root); | |
1139 | - nd->root.mnt = NULL; | |
1140 | - } | |
1138 | + path_put(&nd->root); | |
1139 | + nd->root.mnt = NULL; | |
1141 | 1140 | |
1142 | 1141 | return retval; |
1143 | 1142 | } |