git: hammer2 - Add assertions, fix a flush race against delete-duplicate

Matthew Dillon dillon at crater.dragonflybsd.org
Mon Nov 11 09:18:22 PST 2013


commit 521b4014b37e9ec91d491c8aa868e22651da72e9
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Mon Nov 11 09:15:14 2013 -0800

    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.

Summary of changes:
 sys/vfs/hammer2/hammer2.h       |  4 ++-
 sys/vfs/hammer2/hammer2_chain.c | 70 +++++++++++++++++++++++++----------------
 sys/vfs/hammer2/hammer2_flush.c |  6 ++++
 3 files changed, 52 insertions(+), 28 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/521b4014b37e9ec91d491c8aa868e22651da72e9


-- 
DragonFly BSD source repository



More information about the Commits mailing list