git: hammer2 - Stabilization

Matthew Dillon dillon at
Fri Nov 15 00:23:17 PST 2013

commit 623d43d4bac0d56862c31c924389cd6db3c35114
Author: Matthew Dillon <dillon at>
Date:   Fri Nov 15 00:21:23 2013 -0800

    hammer2 - Stabilization
    Yet more stabilization.  Generally speaking the code is starting to look
    pretty good, but finding the corner cases for the in-memory chain state
    has taken more time than I had hoped.  All of this complexity exists solely
    in order to allow flushes to run concurrently with modifying operations by
    the front-end (which is a pretty significant performance feature).
    * Fix a bug in the hammer2_chain_get() race detection code.
    * Refactor hammer2_freemap_alloc() a bit.
    * Save debug info in dead block array fields (temporary), and add some
      debugging field to the chain structure.
    * Refactor the flush code that checks whether a deleted chain should be
      ignored or not, fixing a bug at the same time.
    * Refactor the transaction sequencing.  Flushes now allocate an extra
      transaction id so a distinction can be made between chains whos block
      arrays have not been updated and chains whos block arrays have been
    * Refactor the MOVED flag removal algorithm a little, fixing a bug or two.
    * Adjust the freemap to detect forked chains and ensure that a different
      reserved block is calculated for the two possible forks.
    * Fix a few mount fail cases that were panicing.
    * Update bref.mirror_tid in scan1 skip cases.
    * Do not update bref.mirror_tid in the skip case as this can confuse
      how a child's block array is interpreted in a future flush.
    * Augment chain code with maxloops counters for debugging infinite
    * Remove the CHAIN_DUPLICATED tests in hammer2_chain_find() as this can
      catch a delete-duplicate in-progress and incorrectly cause the search
      to fail.
    * Remove looping on CHAIN_DUPLICATED detection.  Instead what we do now
      is lock the chain before testing the CHAIN_DELETED bit.  Locking the
      chain will resolve delete-duplicate races and place the chain in a
      deterministic state.  The CHAIN_DELETED test is then sufficient.

Summary of changes:
 sys/vfs/hammer2/TODO              |  22 +++
 sys/vfs/hammer2/hammer2.h         |  16 ++-
 sys/vfs/hammer2/hammer2_chain.c   | 272 ++++++++++++++++++++++-------------
 sys/vfs/hammer2/hammer2_disk.h    |   7 +
 sys/vfs/hammer2/hammer2_flush.c   | 289 ++++++++++++++++++++------------------
 sys/vfs/hammer2/hammer2_freemap.c |  57 +++++++-
 sys/vfs/hammer2/hammer2_vfsops.c  | 240 +++++++++++++++++--------------
 sys/vfs/hammer2/hammer2_vnops.c   |   4 +-
 8 files changed, 554 insertions(+), 353 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list