]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Jan 2024 10:46:28 +0000 (11:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Jan 2024 10:46:28 +0000 (11:46 +0100)
added patches:
fuse-nlookup-missing-decrement-in-fuse_direntplus_link.patch

queue-4.19/fuse-nlookup-missing-decrement-in-fuse_direntplus_link.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/fuse-nlookup-missing-decrement-in-fuse_direntplus_link.patch b/queue-4.19/fuse-nlookup-missing-decrement-in-fuse_direntplus_link.patch
new file mode 100644 (file)
index 0000000..53bbcae
--- /dev/null
@@ -0,0 +1,47 @@
+From b8bd342d50cbf606666488488f9fea374aceb2d5 Mon Sep 17 00:00:00 2001
+From: ruanmeisi <ruan.meisi@zte.com.cn>
+Date: Tue, 25 Apr 2023 19:13:54 +0800
+Subject: fuse: nlookup missing decrement in fuse_direntplus_link
+
+From: ruanmeisi <ruan.meisi@zte.com.cn>
+
+commit b8bd342d50cbf606666488488f9fea374aceb2d5 upstream.
+
+During our debugging of glusterfs, we found an Assertion failed error:
+inode_lookup >= nlookup, which was caused by the nlookup value in the
+kernel being greater than that in the FUSE file system.
+
+The issue was introduced by fuse_direntplus_link, where in the function,
+fuse_iget increments nlookup, and if d_splice_alias returns failure,
+fuse_direntplus_link returns failure without decrementing nlookup
+https://github.com/gluster/glusterfs/pull/4081
+
+Signed-off-by: ruanmeisi <ruan.meisi@zte.com.cn>
+Fixes: 0b05b18381ee ("fuse: implement NFS-like readdirplus support")
+Cc: <stable@vger.kernel.org> # v3.9
+Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/fuse/dir.c |   10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+--- a/fs/fuse/dir.c
++++ b/fs/fuse/dir.c
+@@ -1314,8 +1314,16 @@ retry:
+                       dput(dentry);
+                       dentry = alias;
+               }
+-              if (IS_ERR(dentry))
++              if (IS_ERR(dentry)) {
++                      if (!IS_ERR(inode)) {
++                              struct fuse_inode *fi = get_fuse_inode(inode);
++
++                              spin_lock(&fc->lock);
++                              fi->nlookup--;
++                              spin_unlock(&fc->lock);
++                      }
+                       return PTR_ERR(dentry);
++              }
+       }
+       if (fc->readdirplus_auto)
+               set_bit(FUSE_I_INIT_RDPLUS, &get_fuse_inode(inode)->state);
index a97a96bd20a96b0bd78c708abee67cb2ed23fc1f..f4659c64ed7b05cc74b0af3d883ff91d700230cd 100644 (file)
@@ -15,3 +15,4 @@ firewire-ohci-suppress-unexpected-system-reboot-in-amd-ryzen-machines-and-asm108
 mm-fix-unmap_mapping_range-high-bits-shift-bug.patch
 mmc-rpmb-fixes-pause-retune-on-all-rpmb-partitions.patch
 mmc-core-cancel-delayed-work-before-releasing-host.patch
+fuse-nlookup-missing-decrement-in-fuse_direntplus_link.patch