aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-12-20 13:41:28 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2012-12-20 13:57:35 -0500
commit741b7c3f77937b2fb7c10aeb4c5c621463582583 (patch)
tree9efdcf5a4cd25d3101e712e219a7c1d1a5d346d1 /fs/namei.c
parent582aa64a04a579d47d05e4a0ee85bf047978ef4d (diff)
path_init(): make -ENOTDIR failure exits consistent
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c4
1 files 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,
1859 if (flags & LOOKUP_ROOT) { 1859 if (flags & LOOKUP_ROOT) {
1860 struct inode *inode = nd->root.dentry->d_inode; 1860 struct inode *inode = nd->root.dentry->d_inode;
1861 if (*name) { 1861 if (*name) {
1862 if (!inode->i_op->lookup) 1862 if (!can_lookup(inode))
1863 return -ENOTDIR; 1863 return -ENOTDIR;
1864 retval = inode_permission(inode, MAY_EXEC); 1864 retval = inode_permission(inode, MAY_EXEC);
1865 if (retval) 1865 if (retval)
@@ -1913,7 +1913,7 @@ static int path_init(int dfd, const char *name, unsigned int flags,
1913 dentry = f.file->f_path.dentry; 1913 dentry = f.file->f_path.dentry;
1914 1914
1915 if (*name) { 1915 if (*name) {
1916 if (!S_ISDIR(dentry->d_inode->i_mode)) { 1916 if (!can_lookup(dentry->d_inode)) {
1917 fdput(f); 1917 fdput(f);
1918 return -ENOTDIR; 1918 return -ENOTDIR;
1919 } 1919 }