Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 190834
b: refs/heads/master
c: 002baee
h: refs/heads/master
v: v3
  • Loading branch information
Jan Kara authored and Linus Torvalds committed May 13, 2010
1 parent eb3adaa commit 378e320
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 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: fc8e38f142dd59f81306ff6a81c1351e9eb0e014
refs/heads/master: 002baeecf53677d2034113e34197ec221f42e037
6 changes: 4 additions & 2 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1641,7 +1641,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
if (nd->last.name[nd->last.len]) {
if (open_flag & O_CREAT)
goto exit;
nd->flags |= LOOKUP_DIRECTORY;
nd->flags |= LOOKUP_DIRECTORY | LOOKUP_FOLLOW;
}

/* just plain open? */
Expand Down Expand Up @@ -1830,14 +1830,16 @@ struct file *do_filp_open(int dfd, const char *pathname,
}
if (open_flag & O_DIRECTORY)
nd.flags |= LOOKUP_DIRECTORY;
if (!(open_flag & O_NOFOLLOW))
nd.flags |= LOOKUP_FOLLOW;
filp = do_last(&nd, &path, open_flag, acc_mode, mode, pathname);
while (unlikely(!filp)) { /* trailing symlink */
struct path holder;
struct inode *inode = path.dentry->d_inode;
void *cookie;
error = -ELOOP;
/* S_ISDIR part is a temporary automount kludge */
if ((open_flag & O_NOFOLLOW) && !S_ISDIR(inode->i_mode))
if (!(nd.flags & LOOKUP_FOLLOW) && !S_ISDIR(inode->i_mode))
goto exit_dput;
if (count++ == 32)
goto exit_dput;
Expand Down

0 comments on commit 378e320

Please sign in to comment.