]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Feb 2022 15:00:18 +0000 (16:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Feb 2022 15:00:18 +0000 (16:00 +0100)
added patches:
nfs-lookup_directory-is-also-ok-with-symlinks.patch

queue-4.14/nfs-lookup_directory-is-also-ok-with-symlinks.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/nfs-lookup_directory-is-also-ok-with-symlinks.patch b/queue-4.14/nfs-lookup_directory-is-also-ok-with-symlinks.patch
new file mode 100644 (file)
index 0000000..f1db204
--- /dev/null
@@ -0,0 +1,43 @@
+From e0caaf75d443e02e55e146fd75fe2efc8aed5540 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+Date: Tue, 8 Feb 2022 13:38:23 -0500
+Subject: NFS: LOOKUP_DIRECTORY is also ok with symlinks
+
+From: Trond Myklebust <trond.myklebust@hammerspace.com>
+
+commit e0caaf75d443e02e55e146fd75fe2efc8aed5540 upstream.
+
+Commit ac795161c936 (NFSv4: Handle case where the lookup of a directory
+fails) [1], part of Linux since 5.17-rc2, introduced a regression, where
+a symbolic link on an NFS mount to a directory on another NFS does not
+resolve(?) the first time it is accessed:
+
+Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
+Fixes: ac795161c936 ("NFSv4: Handle case where the lookup of a directory fails")
+Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
+Tested-by: Donald Buczek <buczek@molgen.mpg.de>
+Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nfs/dir.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/nfs/dir.c
++++ b/fs/nfs/dir.c
+@@ -1610,14 +1610,14 @@ no_open:
+       if (!res) {
+               inode = d_inode(dentry);
+               if ((lookup_flags & LOOKUP_DIRECTORY) && inode &&
+-                  !S_ISDIR(inode->i_mode))
++                  !(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)))
+                       res = ERR_PTR(-ENOTDIR);
+               else if (inode && S_ISREG(inode->i_mode))
+                       res = ERR_PTR(-EOPENSTALE);
+       } else if (!IS_ERR(res)) {
+               inode = d_inode(res);
+               if ((lookup_flags & LOOKUP_DIRECTORY) && inode &&
+-                  !S_ISDIR(inode->i_mode)) {
++                  !(S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))) {
+                       dput(res);
+                       res = ERR_PTR(-ENOTDIR);
+               } else if (inode && S_ISREG(inode->i_mode)) {
index a2df0d7c9012479d0518cb8e566b3c38ed17fc16..de36ebdb7f331e12a2b8ff69d5078967a8e8df3e 100644 (file)
@@ -29,3 +29,4 @@ alsa-hda-fix-missing-codec-probe-on-shenker-dock-15.patch
 asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw.patch
 asoc-ops-fix-stereo-change-notifications-in-snd_soc_put_volsw_range.patch
 powerpc-lib-sstep-fix-ptesync-build-error.patch
+nfs-lookup_directory-is-also-ok-with-symlinks.patch