From c13e0552c031b414aff9e4442166095e5b30a07c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 4 Mar 2011 14:44:37 -0500 Subject: [PATCH] --- yaml --- r: 234257 b: refs/heads/master c: 951361f954596bd134d4270df834f47d151f98a6 h: refs/heads/master i: 234255: 2774bbf4cd5aadfae006e9b6939b283c2a9bebf2 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 001b66035f3b..00b8b4a8b60a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a7472baba22dd5d68580f528374f93421b33667e +refs/heads/master: 951361f954596bd134d4270df834f47d151f98a6 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index 53bba7c1a520..85f6e39b4034 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -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 @@ -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; }