From: Greg Kroah-Hartman Date: Sun, 20 Feb 2022 15:00:18 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v4.9.303~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c06e6057670488f331822384473e587ef9bfff84;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: nfs-lookup_directory-is-also-ok-with-symlinks.patch --- 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 index 00000000000..f1db204f8ff --- /dev/null +++ b/queue-4.14/nfs-lookup_directory-is-also-ok-with-symlinks.patch @@ -0,0 +1,43 @@ +From e0caaf75d443e02e55e146fd75fe2efc8aed5540 Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Tue, 8 Feb 2022 13:38:23 -0500 +Subject: NFS: LOOKUP_DIRECTORY is also ok with symlinks + +From: Trond Myklebust + +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 +Fixes: ac795161c936 ("NFSv4: Handle case where the lookup of a directory fails") +Signed-off-by: Trond Myklebust +Tested-by: Donald Buczek +Signed-off-by: Anna Schumaker +Signed-off-by: Greg Kroah-Hartman +--- + 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)) { diff --git a/queue-4.14/series b/queue-4.14/series index a2df0d7c901..de36ebdb7f3 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -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