Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234254
b: refs/heads/master
c: 4455ca6
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Mar 14, 2011
1 parent cb90363 commit 3fab534
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: 9856fa1b281eccdc9f8d94d716e96818c675e78e
refs/heads/master: 4455ca6223cc59cbc0a75f4be8bce9e84cc0d6b8
30 changes: 16 additions & 14 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1405,8 +1405,9 @@ static int link_path_walk(const char *name, struct nameidata *nd)
* parent relationships.
*/
if (unlikely(type != LAST_NORM)) {
if (handle_dots(nd, type))
return -ECHILD;
err = handle_dots(nd, type);
if (err)
goto return_err;
continue;
}

Expand Down Expand Up @@ -1441,8 +1442,9 @@ 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 (handle_dots(nd, type))
return -ECHILD;
err = handle_dots(nd, type);
if (err)
goto return_err;
return 0;
}
err = do_lookup(nd, &this, &next, &inode);
Expand Down Expand Up @@ -1475,6 +1477,12 @@ static int link_path_walk(const char *name, struct nameidata *nd)
if (!(nd->flags & LOOKUP_RCU))
path_put(&nd->path);
return_err:
if (nd->flags & LOOKUP_RCU) {
nd->flags &= ~LOOKUP_RCU;
nd->root.mnt = NULL;
rcu_read_unlock();
br_read_unlock(vfsmount_lock);
}
return err;
}

Expand Down Expand Up @@ -1585,16 +1593,10 @@ static int path_lookupat(int dfd, const char *name,
retval = link_path_walk(name, nd);

if (nd->flags & LOOKUP_RCU) {
/* RCU dangling. Cancel it. */
if (!retval) {
if (nameidata_drop_rcu_last(nd))
retval = -ECHILD;
} else {
nd->flags &= ~LOOKUP_RCU;
nd->root.mnt = NULL;
rcu_read_unlock();
br_read_unlock(vfsmount_lock);
}
/* went all way through without dropping RCU */
BUG_ON(retval);
if (nameidata_drop_rcu_last(nd))
retval = -ECHILD;
}

if (!retval)
Expand Down

0 comments on commit 3fab534

Please sign in to comment.