aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2012-03-06 07:56:34 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-03-10 17:05:30 -0500
commit7f6c7e62fcc123e6bd9206da99a2163fe3facc31 (patch)
tree1ab20c92d09849bee893a80baefa0057bbc072ed /fs/namei.c
parent097b180ca09b581ef0dc24fbcfc1b227de3875df (diff)
vfs: fix return value from do_last()
complete_walk() returns either ECHILD or ESTALE. do_last() turns this into ECHILD unconditionally. If not in RCU mode, this error will reach userspace which is complete nonsense. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: stable@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c
index f79aef16320b..46ea9cc16647 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2162,7 +2162,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
2162 /* sayonara */ 2162 /* sayonara */
2163 error = complete_walk(nd); 2163 error = complete_walk(nd);
2164 if (error) 2164 if (error)
2165 return ERR_PTR(-ECHILD); 2165 return ERR_PTR(error);
2166 2166
2167 error = -ENOTDIR; 2167 error = -ENOTDIR;
2168 if (nd->flags & LOOKUP_DIRECTORY) { 2168 if (nd->flags & LOOKUP_DIRECTORY) {