aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-09-21 03:48:33 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-09-21 03:48:33 -0400
commitf70cac8d9c7125f83048f8b3d1c60f5a041a165c (patch)
tree0d0efd72c1a41f973a919b16aac1d8210ed1ee30 /fs/namei.c
parent4722cd7741c6404f967f7a7b8b666540b6c1663e (diff)
parent08aab447c56a5388cf0c768da476ad022f00fef8 (diff)
Merge branch 'kprobes-test' of git://git.yxit.co.uk/linux into devel-stable
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 2826db35dc25..b52bc685465f 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -727,25 +727,22 @@ static int follow_automount(struct path *path, unsigned flags,
727 if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_PARENT)) 727 if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_PARENT))
728 return -EISDIR; /* we actually want to stop here */ 728 return -EISDIR; /* we actually want to stop here */
729 729
730 /* 730 /* We don't want to mount if someone's just doing a stat -
731 * We don't want to mount if someone's just doing a stat and they've 731 * unless they're stat'ing a directory and appended a '/' to
732 * set AT_SYMLINK_NOFOLLOW - unless they're stat'ing a directory and 732 * the name.
733 * appended a '/' to the name. 733 *
734 * We do, however, want to mount if someone wants to open or
735 * create a file of any type under the mountpoint, wants to
736 * traverse through the mountpoint or wants to open the
737 * mounted directory. Also, autofs may mark negative dentries
738 * as being automount points. These will need the attentions
739 * of the daemon to instantiate them before they can be used.
734 */ 740 */
735 if (!(flags & LOOKUP_FOLLOW)) { 741 if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
736 /* We do, however, want to mount if someone wants to open or 742 LOOKUP_OPEN | LOOKUP_CREATE)) &&
737 * create a file of any type under the mountpoint, wants to 743 path->dentry->d_inode)
738 * traverse through the mountpoint or wants to open the mounted 744 return -EISDIR;
739 * directory. 745
740 * Also, autofs may mark negative dentries as being automount
741 * points. These will need the attentions of the daemon to
742 * instantiate them before they can be used.
743 */
744 if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
745 LOOKUP_OPEN | LOOKUP_CREATE)) &&
746 path->dentry->d_inode)
747 return -EISDIR;
748 }
749 current->total_link_count++; 746 current->total_link_count++;
750 if (current->total_link_count >= 40) 747 if (current->total_link_count >= 40)
751 return -ELOOP; 748 return -ELOOP;