Commit 8c1b4566 authored by Al Viro's avatar Al Viro

enable passing fast relative symlinks without dropping out of RCU mode

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 8fa9dd24
...@@ -975,11 +975,6 @@ const char *get_link(struct nameidata *nd) ...@@ -975,11 +975,6 @@ const char *get_link(struct nameidata *nd)
touch_atime(&last->link); touch_atime(&last->link);
} }
if (nd->flags & LOOKUP_RCU) {
if (unlikely(unlazy_walk(nd, NULL, 0)))
return ERR_PTR(-ECHILD);
}
error = security_inode_follow_link(dentry, inode, error = security_inode_follow_link(dentry, inode,
nd->flags & LOOKUP_RCU); nd->flags & LOOKUP_RCU);
if (unlikely(error)) if (unlikely(error))
...@@ -988,6 +983,10 @@ const char *get_link(struct nameidata *nd) ...@@ -988,6 +983,10 @@ const char *get_link(struct nameidata *nd)
nd->last_type = LAST_BIND; nd->last_type = LAST_BIND;
res = inode->i_link; res = inode->i_link;
if (!res) { if (!res) {
if (nd->flags & LOOKUP_RCU) {
if (unlikely(unlazy_walk(nd, NULL, 0)))
return ERR_PTR(-ECHILD);
}
res = inode->i_op->follow_link(dentry, &last->cookie); res = inode->i_op->follow_link(dentry, &last->cookie);
if (IS_ERR_OR_NULL(res)) { if (IS_ERR_OR_NULL(res)) {
last->cookie = NULL; last->cookie = NULL;
...@@ -995,6 +994,10 @@ const char *get_link(struct nameidata *nd) ...@@ -995,6 +994,10 @@ const char *get_link(struct nameidata *nd)
} }
} }
if (*res == '/') { if (*res == '/') {
if (nd->flags & LOOKUP_RCU) {
if (unlikely(unlazy_walk(nd, NULL, 0)))
return ERR_PTR(-ECHILD);
}
if (!nd->root.mnt) if (!nd->root.mnt)
set_root(nd); set_root(nd);
path_put(&nd->path); path_put(&nd->path);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment