Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262066
b: refs/heads/master
c: 5a30d8a
h: refs/heads/master
v: v3
  • Loading branch information
David Howells authored and Al Viro committed Aug 1, 2011
1 parent ba9fe3e commit b5b74d8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 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: b4aff1f874f679320c03e3d97b60fc7babfd4623
refs/heads/master: 5a30d8a2b8ddd5102c440c7e5a7c8e1fd729c818
24 changes: 15 additions & 9 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,19 +716,25 @@ static int follow_automount(struct path *path, unsigned flags,
if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_PARENT))
return -EISDIR; /* we actually want to stop here */

/* We want to mount if someone is trying to open/create a file of any
* type under the mountpoint, wants to traverse through the mountpoint
* or wants to open the mounted directory.
*
/*
* We don't want to mount if someone's just doing a stat and they've
* set AT_SYMLINK_NOFOLLOW - unless they're stat'ing a directory and
* appended a '/' to the name.
*/
if (!(flags & LOOKUP_FOLLOW) &&
!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
LOOKUP_OPEN | LOOKUP_CREATE)))
return -EISDIR;

if (!(flags & LOOKUP_FOLLOW)) {
/* We do, however, want to mount if someone wants to open or
* create a file of any type under the mountpoint, wants to
* traverse through the mountpoint or wants to open the mounted
* directory.
* Also, autofs may mark negative dentries as being automount
* points. These will need the attentions of the daemon to
* instantiate them before they can be used.
*/
if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
LOOKUP_OPEN | LOOKUP_CREATE)) &&
path->dentry->d_inode)
return -EISDIR;
}
current->total_link_count++;
if (current->total_link_count >= 40)
return -ELOOP;
Expand Down

0 comments on commit b5b74d8

Please sign in to comment.