If a fuse file system is mounted with "-o async", then VOP_READ may be
called with the vnode locked in shared mode rather than exclusive mode.
But if the vnode's attribute cache has expired, then the kernel will
attempt to update it. That triggers an vnode-not-exclusively-locked
assertion.
Fix the bug by attempting to upgrade the shared lock to an exclusive
lock. If the upgrade fails, simply don't cache the new attributes. The
attribute cache will remain stale, and a subsequent read (or other
operation) on the same vnode will attempt to fetch the attributes and
update the cache again.
This bug has been present for a long time, but the assertion was
disabled on stock kernels (including with INVARIANTS) until 15.0.
PR: 291064
Reported by: markj, vishwin, groenveld@acm.org
MFC after: 2 weeks
Sponsored by: ConnectWise