aboutsummaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro2020-01-19 12:48:44 -0500
committerAl Viro2020-03-13 21:09:12 -0400
commitb1a819724074f96bfd41c8f7825c3974b91fe518 (patch)
tree3f5c4c837bc7433c834514852111d31af54f6c90 /fs/namei.c
parent8c4efe22e7c4de1d44f624120a979e31e3a584b8 (diff)
pick_link(): check for WALK_TRAILING, not LOOKUP_PARENT
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 5d25a3874a5b..ff028f12cb95 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1723,8 +1723,10 @@ static inline int handle_dots(struct nameidata *nd, int type)
return 0;
}
+enum {WALK_TRAILING = 1, WALK_MORE = 2, WALK_NOFOLLOW = 4};
+
static const char *pick_link(struct nameidata *nd, struct path *link,
- struct inode *inode, unsigned seq)
+ struct inode *inode, unsigned seq, int flags)
{
struct saved *last;
const char *res;
@@ -1762,7 +1764,7 @@ static const char *pick_link(struct nameidata *nd, struct path *link,
clear_delayed_call(&last->done);
last->seq = seq;
- if (!(nd->flags & LOOKUP_PARENT)) {
+ if (flags & WALK_TRAILING) {
error = may_follow_link(nd, inode);
if (unlikely(error))
return ERR_PTR(error);
@@ -1819,8 +1821,6 @@ all_done: // pure jump
return NULL;
}
-enum {WALK_TRAILING = 1, WALK_MORE = 2, WALK_NOFOLLOW = 4};
-
/*
* Do we need to follow links? We _really_ want to be able
* to do this check without having to look at inode->i_op,
@@ -1849,7 +1849,7 @@ static const char *step_into(struct nameidata *nd, int flags,
if (read_seqcount_retry(&path.dentry->d_seq, seq))
return ERR_PTR(-ECHILD);
}
- return pick_link(nd, &path, inode, seq);
+ return pick_link(nd, &path, inode, seq, flags);
}
static const char *walk_component(struct nameidata *nd, int flags)