Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185927
b: refs/heads/master
c: 9e67f36
h: refs/heads/master
i:
  185925: 472c196
  185923: 19a9883
  185919: 4d33d18
v: v3
  • Loading branch information
Al Viro committed Mar 5, 2010
1 parent f4bc2ed commit 0c26612
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 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: 67ee3ad21d0d0b2cc0b70708de8aed860fadda44
refs/heads/master: 9e67f36169117e07daf16dc7ca314f1db9e2050a
21 changes: 7 additions & 14 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1647,15 +1647,12 @@ static struct file *finish_open(struct nameidata *nd,

static struct file *do_last(struct nameidata *nd, struct path *path,
int open_flag, int acc_mode,
int mode, const char *pathname,
int *is_link)
int mode, const char *pathname)
{
struct dentry *dir = nd->path.dentry;
struct file *filp;
int error;

*is_link = 0;

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

Expand Down Expand Up @@ -1727,10 +1724,9 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
error = -ENOENT;
if (!path->dentry->d_inode)
goto exit_dput;
if (path->dentry->d_inode->i_op->follow_link) {
*is_link = 1;

if (path->dentry->d_inode->i_op->follow_link)
return NULL;
}

path_to_nameidata(path, nd);
error = -EISDIR;
Expand Down Expand Up @@ -1766,7 +1762,6 @@ struct file *do_filp_open(int dfd, const char *pathname,
int count = 0;
int flag = open_to_namei_flags(open_flag);
int force_reval = 0;
int is_link;

/*
* O_SYNC is implemented as __O_SYNC|O_DSYNC. As many places only
Expand Down Expand Up @@ -1849,9 +1844,8 @@ struct file *do_filp_open(int dfd, const char *pathname,
nd.flags |= LOOKUP_CREATE | LOOKUP_OPEN;
if (open_flag & O_EXCL)
nd.flags |= LOOKUP_EXCL;
filp = do_last(&nd, &path, open_flag, acc_mode, mode,
pathname, &is_link);
if (is_link)
filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname);
if (!filp)
goto do_link;
if (nd.root.mnt)
path_put(&nd.root);
Expand Down Expand Up @@ -1902,11 +1896,10 @@ struct file *do_filp_open(int dfd, const char *pathname,
return ERR_PTR(error);
}
nd.flags &= ~LOOKUP_PARENT;
filp = do_last(&nd, &path, open_flag, acc_mode, mode,
pathname, &is_link);
filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname);
if (nd.last_type == LAST_NORM)
__putname(nd.last.name);
if (is_link)
if (!filp)
goto do_link;
if (nd.root.mnt)
path_put(&nd.root);
Expand Down

0 comments on commit 0c26612

Please sign in to comment.