]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
fusefs: fix a recurse-on-non-recursive lockmgr panic
authorAlan Somers <asomers@FreeBSD.org>
Sat, 2 Oct 2021 18:17:36 +0000 (12:17 -0600)
committerAlan Somers <asomers@FreeBSD.org>
Tue, 12 Oct 2021 05:13:58 +0000 (23:13 -0600)
commit2ccb87689fdf15b62e1a7d078ccd21db53a07e9f
tree4f76844a30e954d71e858ee8e2d024004224c172
parent076040aacb5d58dd924853350136f08d7f37b969
fusefs: fix a recurse-on-non-recursive lockmgr panic

fuse_vnop_bmap needs to know the file's size in order to calculate the
optimum amount of readahead.  If the file's size is unknown, it must ask
the FUSE server.  But if the file's data was previously cached and the
server reports that its size has shrunk, fusefs must invalidate the
cached data.  That's not possible during VOP_BMAP because the buffer
object is already locked.

Fix the panic by not querying the FUSE server for the file's size during
VOP_BMAP if we don't need it.  That's also a a slight performance
optimization.

PR: 256937
Reported by: Agata <chogata@moosefs.pro>
Tested by: Agata <chogata@moosefs.pro>

(cherry picked from commit 7430017b9978cae054ed99e5160f739e5ca021d5)
sys/fs/fuse/fuse_vnops.c
tests/sys/fs/fusefs/bmap.cc