HomeFreeBSD

fusefs: fix a recurse-on-non-recursive lockmgr panic

Description

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)

Details

Provenance
asomersAuthored on Oct 2 2021, 6:17 PM
Parents
rG94b01af1e595: fusefs: quiet some cache-related warnings
Branches
Unknown
Tags
Unknown