diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2012-03-06 13:56:34 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-10 23:05:30 +0100 |
commit | 7f6c7e62fcc123e6bd9206da99a2163fe3facc31 (patch) | |
tree | 1ab20c92d09849bee893a80baefa0057bbc072ed /fs | |
parent | vfs: fix double put after complete_walk() (diff) | |
download | linux-7f6c7e62fcc123e6bd9206da99a2163fe3facc31.tar.xz linux-7f6c7e62fcc123e6bd9206da99a2163fe3facc31.zip |
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')
-rw-r--r-- | fs/namei.c | 2 |
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, /* sayonara */ error = complete_walk(nd); if (error) - return ERR_PTR(-ECHILD); + return ERR_PTR(error); error = -ENOTDIR; if (nd->flags & LOOKUP_DIRECTORY) { |