From 741b7c3f77937b2fb7c10aeb4c5c621463582583 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 20 Dec 2012 13:41:28 -0500 Subject: [PATCH] path_init(): make -ENOTDIR failure exits consistent Signed-off-by: Al Viro --- fs/namei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index e245d88b4d69..35195ff9d194 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1859,7 +1859,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, if (flags & LOOKUP_ROOT) { struct inode *inode = nd->root.dentry->d_inode; if (*name) { - if (!inode->i_op->lookup) + if (!can_lookup(inode)) return -ENOTDIR; retval = inode_permission(inode, MAY_EXEC); if (retval) @@ -1913,7 +1913,7 @@ static int path_init(int dfd, const char *name, unsigned int flags, dentry = f.file->f_path.dentry; if (*name) { - if (!S_ISDIR(dentry->d_inode->i_mode)) { + if (!can_lookup(dentry->d_inode)) { fdput(f); return -ENOTDIR; } -- 2.20.1