hammer2 - Redo refactor code, fix races, add assertions
authorMatthew Dillon <dillon@apollo.backplane.com>
Sun, 29 Sep 2013 06:30:11 +0000 (23:30 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sun, 29 Sep 2013 06:30:11 +0000 (23:30 -0700)
commit294fa5f98cf8540c6be7dc17ae6d8f766846f89e
tree8c0c6be966de38cb20bc408160ceb0d086a925f5
parent27b04eddb6a84dd0febe7db0b30a9e43bb704403
hammer2 - Redo refactor code, fix races, add assertions

* Redo the refactor code which is used to detect when a chain
  has been delete-duplicated so the caller can translate a stale
  chain pointer into an up-to-date chain pointer.

  The new code uses a simple chain flag, HAMMER2_CHAIN_DUPLICATED,
  to flag that the original chain is now stale.  The old code was
  unnecessarily complex.

* Close several holes in the hardlink code where stale chains
  were improperly being used as starting points for modifications,
  resulting in filesystem corruption.

* Assert the a delete-duplicate is not performed on a stale chain.
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_inode.c