kernel - Fix rare vref() assertion
commit74272eaf4d2c0a0f58092e8f8035e66d1e0c3ce4
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 8 Dec 2018 22:34:51 +0000 (8 14:34 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 8 Dec 2018 22:34:51 +0000 (8 14:34 -0800)
treeb033fa40dda6bca02b68700ecd76a0ce217f0e63
parent563721240355ccee14b7626025e1ecf93f6cd014
kernel - Fix rare vref() assertion

* The VREF_TERMINATE flag gets cleared when a vnode is reactivated.
  However, concurrent LK_SHARED locks on vnodes can race the v_state
  test.  Thus the code cannot assume that VREF_TERMINATE has been cleared
  when v_state is VS_ACTIVE.

  To avoid the race, we simply unconditionally clear VREF_TERMINATE on
  a successful vget().

* Could be reproduced by running blogbench and synth together, both of
  which generate extreme filesystem-intensive loads.
sys/kern/vfs_lock.c