Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234241
b: refs/heads/master
c: 52094c8
h: refs/heads/master
i:
  234239: c36f953
v: v3
  • Loading branch information
Al Viro committed Mar 14, 2011
1 parent 0c120cb commit 2207d37
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 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: c9c6cac0c2bdbda42e7b804838648d0bc60ddb13
refs/heads/master: 52094c8a0610cf57920ad4c6c57470ae2ccbbd25
25 changes: 14 additions & 11 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,18 @@ static int do_lookup(struct nameidata *nd, struct qstr *name,
return PTR_ERR(dentry);
}

static inline int may_lookup(struct nameidata *nd)
{
if (nd->flags & LOOKUP_RCU) {
int err = exec_permission(nd->inode, IPERM_FLAG_RCU);
if (err != -ECHILD)
return err;
if (nameidata_drop_rcu(nd))
return -ECHILD;
}
return exec_permission(nd->inode, 0);
}

/*
* Name resolution.
* This is the basic name resolution function, turning a pathname into
Expand Down Expand Up @@ -1352,17 +1364,8 @@ static int link_path_walk(const char *name, struct nameidata *nd)
unsigned int c;

nd->flags |= LOOKUP_CONTINUE;
if (nd->flags & LOOKUP_RCU) {
err = exec_permission(nd->inode, IPERM_FLAG_RCU);
if (err == -ECHILD) {
if (nameidata_drop_rcu(nd))
return -ECHILD;
goto exec_again;
}
} else {
exec_again:
err = exec_permission(nd->inode, 0);
}

err = may_lookup(nd);
if (err)
break;

Expand Down

0 comments on commit 2207d37

Please sign in to comment.