Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234257
b: refs/heads/master
c: 951361f
h: refs/heads/master
i:
  234255: 2774bbf
v: v3
  • Loading branch information
Al Viro committed Mar 14, 2011
1 parent 3f491ba commit c13e055
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 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: a7472baba22dd5d68580f528374f93421b33667e
refs/heads/master: 951361f954596bd134d4270df834f47d151f98a6
21 changes: 13 additions & 8 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,18 @@ static inline int handle_dots(struct nameidata *nd, int type)
return 0;
}

static void terminate_walk(struct nameidata *nd)
{
if (!(nd->flags & LOOKUP_RCU)) {
path_put(&nd->path);
} else {
nd->flags &= ~LOOKUP_RCU;
nd->root.mnt = NULL;
rcu_read_unlock();
br_read_unlock(vfsmount_lock);
}
}

/*
* Name resolution.
* This is the basic name resolution function, turning a pathname into
Expand Down Expand Up @@ -1482,14 +1494,7 @@ static int link_path_walk(const char *name, struct nameidata *nd)
nd->last_type = type;
return 0;
}
if (!(nd->flags & LOOKUP_RCU))
path_put(&nd->path);
if (nd->flags & LOOKUP_RCU) {
nd->flags &= ~LOOKUP_RCU;
nd->root.mnt = NULL;
rcu_read_unlock();
br_read_unlock(vfsmount_lock);
}
terminate_walk(nd);
return err;
}

Expand Down

0 comments on commit c13e055

Please sign in to comment.