FBSD: do not recurse on the afs_xvcache write lock
afs_ShakeLooseVcaches grabs the write lock before calling
osi_TryEvictVCache. The latter calls vgone(l), which sometimes
calls into VOP_CLOSE, which again trys to acquire the write lock,
leading to deadlock. Drop the write lock and reaquire it in
TryEvictVCache as a fix.
While here, set *slept to 1 since we drop the glock.
This churn was enough that the gcc no longer cached the value of
AFSTOV(avc), which gets set to 0 in VOP_RECLAIM, so the subsequent
VOP_UNLOCK dereferenced a null pointer. Cache the vnode pointer
in a local variable for the entire function instead of using
AFSTOV() everywhere.
Change-Id: Ic826e7888cb400c19857c58cb6ed88b9bdd0dddc
Reviewed-on: http://gerrit.openafs.org/2315
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>