]> 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>
Wed, 6 Oct 2021 20:07:33 +0000 (14:07 -0600)
commit7430017b9978cae054ed99e5160f739e5ca021d5
tree2d16872ddb5903a5a986ccdd766634822bcea7a2
parent5d94aaacb5180798b2f698e33937f068386004eb
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>
MFC after: 2 weeks
sys/fs/fuse/fuse_vnops.c
tests/sys/fs/fusefs/bmap.cc