Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234253
b: refs/heads/master
c: 9856fa1
h: refs/heads/master
i:
  234251: 5a296a1
v: v3
  • Loading branch information
Al Viro committed Mar 14, 2011
1 parent b24b356 commit cb90363
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7bc055d1d524f209bf49d8b9cb220712dd7df4ed
refs/heads/master: 9856fa1b281eccdc9f8d94d716e96818c675e78e
30 changes: 16 additions & 14 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,18 @@ static inline int may_lookup(struct nameidata *nd)
return exec_permission(nd->inode, 0);
}

static inline int handle_dots(struct nameidata *nd, int type)
{
if (type == LAST_DOTDOT) {
if (nd->flags & LOOKUP_RCU) {
if (follow_dotdot_rcu(nd))
return -ECHILD;
} else
follow_dotdot(nd);
}
return 0;
}

/*
* Name resolution.
* This is the basic name resolution function, turning a pathname into
Expand Down Expand Up @@ -1393,13 +1405,8 @@ static int link_path_walk(const char *name, struct nameidata *nd)
* parent relationships.
*/
if (unlikely(type != LAST_NORM)) {
if (type == LAST_DOTDOT) {
if (nd->flags & LOOKUP_RCU) {
if (follow_dotdot_rcu(nd))
return -ECHILD;
} else
follow_dotdot(nd);
}
if (handle_dots(nd, type))
return -ECHILD;
continue;
}

Expand Down Expand Up @@ -1434,13 +1441,8 @@ static int link_path_walk(const char *name, struct nameidata *nd)
if (lookup_flags & LOOKUP_PARENT)
goto lookup_parent;
if (unlikely(type != LAST_NORM)) {
if (type == LAST_DOTDOT) {
if (nd->flags & LOOKUP_RCU) {
if (follow_dotdot_rcu(nd))
return -ECHILD;
} else
follow_dotdot(nd);
}
if (handle_dots(nd, type))
return -ECHILD;
return 0;
}
err = do_lookup(nd, &this, &next, &inode);
Expand Down

0 comments on commit cb90363

Please sign in to comment.