kernel - TMPFS - Bug fixing pass - fsync, vnode locks
commit630e3a334375c671bcf4a9e07e80277d839c36db
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 13 Feb 2010 06:45:23 +0000 (12 22:45 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 13 Feb 2010 06:45:23 +0000 (12 22:45 -0800)
treec5a6631012ff76dbb47581f4faaa830f33cd95f7
parent0786baf1fc52cfb8dfbb4703b677a498aa96bfe0
kernel - TMPFS - Bug fixing pass - fsync, vnode locks

* tmpfs_fsync() needs to have a couple of special cases to properly deal
  with the backing store.

  (1) When unmounting any vnode or recycling a dead vnode the backing
      store can be destroyed.

  (2) When recycling a live vnode the OS is trying to free the vnode,
      meaning also free up the buffer cache for that vnode.  tmpfs must
      sync the data to swap backing store.

  (3) Otherwise fsync can be ignored.  We don't want to force data into
      swap.

* The DragonFly kernel handles nearly all vnode and namespace locking
  for VFSs.  If tmpfs tries to do its own it will cause deadlocks.

  At the moment we are not running MPSAFE but ultimately we will have
  to do a pass to properly lock tmpfs_nodes during operations.
sys/vfs/tmpfs/tmpfs_vnops.c