kernel - Fix one-cycle MP race in vshouldmsync()
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 12 Sep 2010 17:30:38 +0000 (10:30 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 12 Sep 2010 17:30:38 +0000 (10:30 -0700)
commitaed76ef1f778cc4185ddd699631316d05d6811b6
tree03df39958f2aedb5b8630212943552f2769cc508
parentb8da4eab67a72fb0db985da92a1515c6c9e60f32
kernel - Fix one-cycle MP race in vshouldmsync()

* vshouldmsync() is the mntvnode fast function, which is called without
  any vnode lock.  vp->v_object can thus get ripped out from under the
  scan function.

  Hold vmobj_token through the scan so any pointer accessed via
  v_object remains stable (even if no longer related to the vnode
  due to the race).

Reported-by: swildner
sys/kern/vfs_mount.c
sys/kern/vfs_subr.c