devfs - Fix a few more issues
commit62e9e4173da92227fd081dae1cb4bc2a8aaee176
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 18 Mar 2018 02:43:01 +0000 (17 19:43 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 18 Mar 2018 02:43:01 +0000 (17 19:43 -0700)
tree371fb9fe39856a94c696ff16916e0a559f5538ba
parent1bef7707524ce5755a66555932471ef19a6dfa0d
devfs - Fix a few more issues

* Fix a devfs_freep() race.  VOP_RECLAIM generated by unrelated
  system load (such as a 'du' which causes vnodes to recycle quickly)
  can race a node teardown because devfs_freep() temporarily unlocks
  devfs_lock across a vnode op.

* Instead of asserting, use the DEVFS_DESTROYED flag to check
  for the race.  The state will be stable for this particular race
  due to the vnode lock.

Reported-by: multiple
sys/sys/devfs.h
sys/vfs/devfs/devfs_core.c
sys/vfs/devfs/devfs_vnops.c