hammer2 - Add assertions, fix a flush race against delete-duplicate
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 11 Nov 2013 17:15:14 +0000 (09:15 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 11 Nov 2013 17:15:14 +0000 (09:15 -0800)
commit521b4014b37e9ec91d491c8aa868e22651da72e9
tree637a63c29aaeba2adb6ee6e1a6033991eef7aa44
parent9c527560a373262253f13890dfa9af4185a1024f
hammer2 - Add assertions, fix a flush race against delete-duplicate

* hammer2_chain_delete_duplicate() does not require a lock on the parent
  chain, nor do we want to require one.  This can result in a race against
  indirect block creation which is trying to D-D chains from an upper chain
  to a lower one.

* Fix the problem by moving the DELETED check in
  hammer2_chain_create_indirect() from before the chain lock to after.

* Minor cleanup of the same routine.

* Add assertions to try to catch any situation where the block table is
  flushed twice, which would cause a later assertion.  Try to catch it
  earlier.
sys/vfs/hammer2/hammer2.h
sys/vfs/hammer2/hammer2_chain.c
sys/vfs/hammer2/hammer2_flush.c