Loading fs/namei.c +7 −14 Original line number Original line Diff line number Diff line Loading @@ -1656,6 +1656,10 @@ static struct file *do_last(struct nameidata *nd, struct path *path, *is_link = 0; *is_link = 0; error = -EISDIR; if (nd->last_type != LAST_NORM || nd->last.name[nd->last.len]) goto exit; mutex_lock(&dir->d_inode->i_mutex); mutex_lock(&dir->d_inode->i_mutex); path->dentry = lookup_hash(nd); path->dentry = lookup_hash(nd); Loading Loading @@ -1826,13 +1830,8 @@ reval: audit_inode(pathname, nd.path.dentry); audit_inode(pathname, nd.path.dentry); /* /* * We have the parent and last component. First of all, check * We have the parent and last component. * that we are not asked to creat(2) an obvious directory - that * will not do. */ */ error = -EISDIR; if (nd.last_type != LAST_NORM || nd.last.name[nd.last.len]) goto exit_parent; error = -ENFILE; error = -ENFILE; filp = get_empty_filp(); filp = get_empty_filp(); Loading Loading @@ -1908,15 +1907,9 @@ do_link: nd.flags &= ~LOOKUP_PARENT; nd.flags &= ~LOOKUP_PARENT; if (nd.last_type == LAST_BIND) if (nd.last_type == LAST_BIND) goto ok; goto ok; error = -EISDIR; if (nd.last_type != LAST_NORM) goto exit; if (nd.last.name[nd.last.len]) { __putname(nd.last.name); goto exit; } filp = do_last(&nd, &path, open_flag, flag, acc_mode, mode, filp = do_last(&nd, &path, open_flag, flag, acc_mode, mode, pathname, &is_link); pathname, &is_link); if (nd.last_type == LAST_NORM) __putname(nd.last.name); __putname(nd.last.name); if (is_link) if (is_link) goto do_link; goto do_link; Loading Loading
fs/namei.c +7 −14 Original line number Original line Diff line number Diff line Loading @@ -1656,6 +1656,10 @@ static struct file *do_last(struct nameidata *nd, struct path *path, *is_link = 0; *is_link = 0; error = -EISDIR; if (nd->last_type != LAST_NORM || nd->last.name[nd->last.len]) goto exit; mutex_lock(&dir->d_inode->i_mutex); mutex_lock(&dir->d_inode->i_mutex); path->dentry = lookup_hash(nd); path->dentry = lookup_hash(nd); Loading Loading @@ -1826,13 +1830,8 @@ reval: audit_inode(pathname, nd.path.dentry); audit_inode(pathname, nd.path.dentry); /* /* * We have the parent and last component. First of all, check * We have the parent and last component. * that we are not asked to creat(2) an obvious directory - that * will not do. */ */ error = -EISDIR; if (nd.last_type != LAST_NORM || nd.last.name[nd.last.len]) goto exit_parent; error = -ENFILE; error = -ENFILE; filp = get_empty_filp(); filp = get_empty_filp(); Loading Loading @@ -1908,15 +1907,9 @@ do_link: nd.flags &= ~LOOKUP_PARENT; nd.flags &= ~LOOKUP_PARENT; if (nd.last_type == LAST_BIND) if (nd.last_type == LAST_BIND) goto ok; goto ok; error = -EISDIR; if (nd.last_type != LAST_NORM) goto exit; if (nd.last.name[nd.last.len]) { __putname(nd.last.name); goto exit; } filp = do_last(&nd, &path, open_flag, flag, acc_mode, mode, filp = do_last(&nd, &path, open_flag, flag, acc_mode, mode, pathname, &is_link); pathname, &is_link); if (nd.last_type == LAST_NORM) __putname(nd.last.name); __putname(nd.last.name); if (is_link) if (is_link) goto do_link; goto do_link; Loading