From: Miklos Szeredi Date: Tue, 6 Mar 2012 12:56:34 +0000 (+0100) Subject: vfs: fix return value from do_last() X-Git-Tag: v3.2.12~31 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ebccbea3908a4c2d490fdd13d353f1b81be5e276;p=karo-tx-linux.git vfs: fix return value from do_last() commit 7f6c7e62fcc123e6bd9206da99a2163fe3facc31 upstream. 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 Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/namei.c b/fs/namei.c index 744e942fbf45..b8344d0166cc 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2139,7 +2139,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) {