]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
a .27 patch
authorGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Mar 2010 01:31:00 +0000 (17:31 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Mar 2010 01:31:00 +0000 (17:31 -0800)
queue-2.6.27/fix-lookup_follow-on-automount-symlinks.patch [new file with mode: 0644]
queue-2.6.27/series

diff --git a/queue-2.6.27/fix-lookup_follow-on-automount-symlinks.patch b/queue-2.6.27/fix-lookup_follow-on-automount-symlinks.patch
new file mode 100644 (file)
index 0000000..0e3ee1a
--- /dev/null
@@ -0,0 +1,49 @@
+From ac278a9c505092dd82077a2446af8f9fc0d9c095 Mon Sep 17 00:00:00 2001
+From: Al Viro <viro@ZenIV.linux.org.uk>
+Date: Tue, 16 Feb 2010 18:09:36 +0000
+Subject: fix LOOKUP_FOLLOW on automount "symlinks"
+
+From: Al Viro <viro@ZenIV.linux.org.uk>
+
+commit ac278a9c505092dd82077a2446af8f9fc0d9c095 upstream.
+
+Make sure that automount "symlinks" are followed regardless of LOOKUP_FOLLOW;
+it should have no effect on them.
+
+Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/namei.c |   14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+--- a/fs/namei.c
++++ b/fs/namei.c
+@@ -841,6 +841,17 @@ fail:
+ }
+ /*
++ * This is a temporary kludge to deal with "automount" symlinks; proper
++ * solution is to trigger them on follow_mount(), so that do_lookup()
++ * would DTRT.  To be killed before 2.6.34-final.
++ */
++static inline int follow_on_final(struct inode *inode, unsigned lookup_flags)
++{
++      return inode && unlikely(inode->i_op->follow_link) &&
++              ((lookup_flags & LOOKUP_FOLLOW) || S_ISDIR(inode->i_mode));
++}
++
++/*
+  * Name resolution.
+  * This is the basic name resolution function, turning a pathname into
+  * the final dentry. We expect 'base' to be positive and a directory.
+@@ -984,8 +995,7 @@ last_component:
+               if (err)
+                       break;
+               inode = next.dentry->d_inode;
+-              if ((lookup_flags & LOOKUP_FOLLOW)
+-                  && inode && inode->i_op && inode->i_op->follow_link) {
++              if (follow_on_final(inode, lookup_flags)) {
+                       err = do_follow_link(&next, nd);
+                       if (err)
+                               goto return_err;
index 9da1a5d6bd8be742556290bedf8654e2fa0ef758..510f7adda88c5e91e5db1964fb245da3c880bebc 100644 (file)
@@ -30,3 +30,4 @@ drm-r128-add-test-for-initialisation-to-all-ioctls-that-require-it.patch
 tc-fix-unitialized-kernel-memory-leak.patch
 parisc-isa-eeprom-fix-loff_t-usage.patch
 kvm-x86-check-for-cr3-validity-in-ioctl_set_sregs.patch
+fix-lookup_follow-on-automount-symlinks.patch