aboutsummaryrefslogtreecommitdiff
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-03-04 14:35:59 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-14 09:15:25 -0400
commitef7562d5283a91da3ba5c14de3221f47b7f08823 (patch)
treebf517d1a2c205ad475480c958449b2bc25de61b4 /fs/namei.c
parent4455ca6223cc59cbc0a75f4be8bce9e84cc0d6b8 (diff)
make handle_dots() leave RCU mode on error
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/namei.c b/fs/namei.c
index f09887a4583..ea14bfb0478 100644
--- a/fs/namei.c
+++ b/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 @@ last_component:
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;