Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185926
b: refs/heads/master
c: 67ee3ad
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Mar 5, 2010
1 parent 472c196 commit f4bc2ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4296e2cbf2138b5831b83f03e81de916ce1a967d
refs/heads/master: 67ee3ad21d0d0b2cc0b70708de8aed860fadda44
17 changes: 6 additions & 11 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,9 @@ static struct file *do_last(struct nameidata *nd, struct path *path,

*is_link = 0;

if (nd->last_type == LAST_BIND)
goto ok;

error = -EISDIR;
if (nd->last_type != LAST_NORM || nd->last.name[nd->last.len])
goto exit;
Expand Down Expand Up @@ -1733,6 +1736,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
error = -EISDIR;
if (S_ISDIR(path->dentry->d_inode->i_mode))
goto exit;
ok:
filp = finish_open(nd, open_flag, acc_mode);
return filp;

Expand Down Expand Up @@ -1808,7 +1812,7 @@ struct file *do_filp_open(int dfd, const char *pathname,
release_open_intent(&nd);
if (error)
return ERR_PTR(error);
goto ok;
return finish_open(&nd, open_flag, acc_mode);
}

/*
Expand Down Expand Up @@ -1853,21 +1857,14 @@ struct file *do_filp_open(int dfd, const char *pathname,
path_put(&nd.root);
return filp;

ok:
filp = finish_open(&nd, open_flag, acc_mode);
if (nd.root.mnt)
path_put(&nd.root);
return filp;

exit_dput:
path_put_conditional(&path, &nd);
exit:
if (!IS_ERR(nd.intent.open.file))
release_open_intent(&nd);
exit_parent:
path_put(&nd.path);
if (nd.root.mnt)
path_put(&nd.root);
path_put(&nd.path);
return ERR_PTR(error);

do_link:
Expand Down Expand Up @@ -1905,8 +1902,6 @@ struct file *do_filp_open(int dfd, const char *pathname,
return ERR_PTR(error);
}
nd.flags &= ~LOOKUP_PARENT;
if (nd.last_type == LAST_BIND)
goto ok;
filp = do_last(&nd, &path, open_flag, acc_mode, mode,
pathname, &is_link);
if (nd.last_type == LAST_NORM)
Expand Down

0 comments on commit f4bc2ed

Please sign in to comment.