From 2774bbf4cd5aadfae006e9b6939b283c2a9bebf2 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 4 Mar 2011 14:35:59 -0500 Subject: [PATCH] --- yaml --- r: 234255 b: refs/heads/master c: ef7562d5283a91da3ba5c14de3221f47b7f08823 h: refs/heads/master i: 234253: cb903634e301174465f1de14d7d2b54bd89b65bd 234251: 5a296a1792f15e43b1e3778f4097ae2d67e0d911 234247: 13ad09f9cf5ccbee22a72fe08af6d4be3083f0bf 234239: c36f953c61472c01e8877eb1b9a0847441a90f60 v: v3 --- [refs] | 2 +- trunk/fs/namei.c | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/[refs] b/[refs] index b925f747141a..4badbb55a6a3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4455ca6223cc59cbc0a75f4be8bce9e84cc0d6b8 +refs/heads/master: ef7562d5283a91da3ba5c14de3221f47b7f08823 diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index f09887a45831..ea14bfb04785 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -1052,7 +1052,7 @@ static int follow_dotdot_rcu(struct nameidata *nd) seq = read_seqcount_begin(&parent->d_seq); if (read_seqcount_retry(&old->d_seq, nd->seq)) - return -ECHILD; + goto failed; inode = parent->d_inode; nd->path.dentry = parent; nd->seq = seq; @@ -1065,8 +1065,14 @@ static int follow_dotdot_rcu(struct nameidata *nd) } __follow_mount_rcu(nd, &nd->path, &inode, true); nd->inode = inode; - return 0; + +failed: + nd->flags &= ~LOOKUP_RCU; + nd->root.mnt = NULL; + rcu_read_unlock(); + br_read_unlock(vfsmount_lock); + return -ECHILD; } /* @@ -1405,9 +1411,8 @@ static int link_path_walk(const char *name, struct nameidata *nd) * parent relationships. */ if (unlikely(type != LAST_NORM)) { - err = handle_dots(nd, type); - if (err) - goto return_err; + if (handle_dots(nd, type)) + return -ECHILD; continue; } @@ -1441,12 +1446,8 @@ static int link_path_walk(const char *name, struct nameidata *nd) nd->flags &= lookup_flags | ~LOOKUP_CONTINUE; if (lookup_flags & LOOKUP_PARENT) goto lookup_parent; - if (unlikely(type != LAST_NORM)) { - err = handle_dots(nd, type); - if (err) - goto return_err; - return 0; - } + if (unlikely(type != LAST_NORM)) + return handle_dots(nd, type); err = do_lookup(nd, &this, &next, &inode); if (err) break;