kernel - Close MP race in vnode allocation code
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 6 Feb 2010 17:09:22 +0000 (09:09 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 6 Feb 2010 17:09:22 +0000 (09:09 -0800)
commitb8b1dca3e2045dad434bd948e1225757e8dfbe97
treee57c9a4f15ac80af7be30654adbc19f84265bef4
parentb9a09edee8fcb479c571cc3c8778211ebb64fb73
kernel - Close MP race in vnode allocation code

* vx_lock_nonblock() is used by allocfreevnode() to interlock the
  vnode being freed.  However, this function will incorrect succeed
  on a vnode recursively held by a caller of allocfreevnode() which
  is in the middle of being reclaimed if the vnode in question
  allows LK_CANRECURSE locks in the lockinit.  UFS vnodes use this
  mechanic.

  Add a little bit of code to close the hole.
sys/kern/vfs_lock.c