FBSD: Avoid holding AFS_GLOCK during vinvalbuf 70/13970/5
authorAndrew Deason <adeason@dson.org>
Wed, 27 Nov 2019 05:39:24 +0000 (23:39 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 24 Apr 2020 03:18:58 +0000 (23:18 -0400)
commit61993cf45a648906abb865756d5a98d9c2d7cc40
tree944459e2b32e9065cd59da70caa9d9af0f780844
parente510e35b25f605090524598b6b48cd20d3102945
FBSD: Avoid holding AFS_GLOCK during vinvalbuf

Currently we call vinvalbuf(9) in a few places while holding
AFS_GLOCK, but AFS_GLOCK is a non-sleepable lock (struct mtx), and
vinvalbuf can sleep. This can trigger a panic in some rare conditions,
with the message:

    Sleeping thread (tid 100179, pid 95481) owns a non-sleepable lock

To avoid this, drop AFS_GLOCK around a few places that call
vinvalbuf().

Change-Id: I58acb144b6ffa007675402e7639b63ff3745dec5
Reviewed-on: https://gerrit.openafs.org/13970
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/afs/FBSD/osi_vm.c
src/afs/afs_osi_vm.c
src/afs/afs_vcache.c