]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fusefs: fix a panic in VOP_READDIR
authorasomers <asomers@FreeBSD.org>
Wed, 3 Apr 2019 20:57:43 +0000 (20:57 +0000)
committerasomers <asomers@FreeBSD.org>
Wed, 3 Apr 2019 20:57:43 +0000 (20:57 +0000)
commit09d73b9632d8c77fc546a50317d71588e98c25d9
tree4bfbc336061db152391e29095b2dd0f9ea3e5566
parent058ae6dccffce9ef2a4d88cf20644f9b2b7f8961
fusefs: fix a panic in VOP_READDIR

The original fusefs import, r238402, contained a bug in fuse_vnop_close that
could close a directory's file handle while there were still other open file
descriptors.  The code looks deliberate, but there is no explanation for it.
This necessitated a workaround in fuse_vnop_readdir that would open a new
file handle if, "for some mysterious reason", that vnode didn't have any
open file handles.  r345781 had the effect of causing the workaround to
panic, making the problem more visible.

This commit removes the workaround and the original bug, which also fixes
the panic.

Sponsored by: The FreeBSD Foundation
sys/fs/fuse/fuse_vnops.c
tests/sys/fs/fusefs/readdir.cc
tests/sys/fs/fusefs/releasedir.cc
tests/sys/fs/fusefs/utils.cc
tests/sys/fs/fusefs/utils.hh