fuse: nlookup missing decrement in fuse_direntplus_link
authorruanmeisi <ruan.meisi@zte.com.cn>
Tue, 25 Apr 2023 11:13:54 +0000 (19:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:28:05 +0000 (12:28 +0200)
commitef819c2f8e8a0da58d765ab1960cb976565ce0af
tree1d2204560b05c28ea0bbfdbbccbf0ee6d19acc71
parent6694be119f632fe57aa1a4b36008e5ed460e27e8
fuse: nlookup missing decrement in fuse_direntplus_link

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/readdir.c