From 0cce87b4bffa0b9ae509e0408b5c7521619a7602 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 20 Sep 2011 09:36:09 -0700 Subject: 3.0 patches --- queue-3.0/series | 1 + ...vfs-automount-should-ignore-lookup_follow.patch | 66 ++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 queue-3.0/vfs-automount-should-ignore-lookup_follow.patch diff --git a/queue-3.0/series b/queue-3.0/series index 13daeb95c0..6e6965eca8 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -100,3 +100,4 @@ pci-set-pci-e-max-payload-size-on-fabric.patch pci-export-pcie_bus_configure_settings-symbol.patch pci-remove-mrrs-modification-from-mps-setting-code.patch isci-fix-sata-response-handling.patch +vfs-automount-should-ignore-lookup_follow.patch diff --git a/queue-3.0/vfs-automount-should-ignore-lookup_follow.patch b/queue-3.0/vfs-automount-should-ignore-lookup_follow.patch new file mode 100644 index 0000000000..87851385a5 --- /dev/null +++ b/queue-3.0/vfs-automount-should-ignore-lookup_follow.patch @@ -0,0 +1,66 @@ +From 0ec26fd0698285b31248e34bf1abb022c00f23d6 Mon Sep 17 00:00:00 2001 +From: Miklos Szeredi +Date: Mon, 5 Sep 2011 18:06:26 +0200 +Subject: vfs: automount should ignore LOOKUP_FOLLOW + +From: Miklos Szeredi + +commit 0ec26fd0698285b31248e34bf1abb022c00f23d6 upstream. + +Prior to 2.6.38 automount would not trigger on either stat(2) or +lstat(2) on the automount point. + +After 2.6.38, with the introduction of the ->d_automount() +infrastructure, stat(2) and others would start triggering automount +while lstat(2), etc. still would not. This is a regression and a +userspace ABI change. + +Problem originally reported here: + + http://thread.gmane.org/gmane.linux.kernel.autofs/6098 + +It appears that there was an attempt at fixing various userspace tools +to not trigger the automount. But since the stat system call is +rather common it is impossible to "fix" all userspace. + +This patch reverts the original behavior, which is to not trigger on +stat(2) and other symlink following syscalls. + +[ It's not really clear what the right behavior is. Apparently Solaris + does the "automount on stat, leave alone on lstat". And some programs + can get unhappy when "stat+open+fstat" ends up giving a different + result from the fstat than from the initial stat. + + But the change in 2.6.38 resulted in problems for some people, so + we're going back to old behavior. Maybe we can re-visit this + discussion at some future date - Linus ] + +Reported-by: Leonardo Chiquitto +Signed-off-by: Miklos Szeredi +Acked-by: Ian Kent +Cc: David Howells +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/namei.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +--- a/fs/namei.c ++++ b/fs/namei.c +@@ -783,12 +783,10 @@ static int follow_automount(struct path + * 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. ++ * We don't want to mount if someone's just doing a stat - unless ++ * they're stat'ing a directory and appended a '/' to the name. + */ +- if (!(flags & LOOKUP_FOLLOW) && +- !(flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY | ++ if (!(flags & (LOOKUP_CONTINUE | LOOKUP_DIRECTORY | + LOOKUP_OPEN | LOOKUP_CREATE))) + return -EISDIR; + -- cgit 1.2.3-korg