git: hammer2 hammer2 - Fix lost flush

Matthew Dillon dillon at
Sun May 20 11:26:19 PDT 2012

commit 26b047fa2d693b02fafbb86a1b2448ce38a4e84c
Author: Matthew Dillon <dillon at>
Date:   Sun May 20 11:12:58 2012 -0700

    hammer2 - Fix lost flush
    * hammer2 allows the buffer cache buffers related to MODIFIED but unlocked
      chains to be retired by the OS.  In this situation hammer2 does not want
      to bdwrite() the buffer again unless additional modifications are made,
      even though the MODIFIED bit in the chain remains set throughout the
      entire sequence.
    * Fix a case where these additional modifications were not properly flagging
      for the buffer cache buffer to be retired with a bdwrite(), causing data
      loss.  This is related to the DIRTYBP chain flag.
    * Make further adjustments to the DIRTYBP chain flag.
    * Also fix a case where the MOVED bit might not get properly set when a
      block is resized.  The problem was masked by the fact that a resize
      only occurs on data blocks and only during a write(), so the related
      buffer was being marked MODIFIED anyway.  However, the resize code still
      needed to be corrected.
    * Add some debugging to 'hammer2 stat' to make it easier to poke around
      related kernel structures.

Summary of changes:
 sbin/hammer2/cmd_stat.c         |    3 +-
 sys/vfs/hammer2/hammer2_chain.c |   41 ++++++++++++++++++++++++++++++++------
 sys/vfs/hammer2/hammer2_inode.c |    5 ++++
 sys/vfs/hammer2/hammer2_ioctl.c |    1 +
 sys/vfs/hammer2/hammer2_ioctl.h |    1 +
 5 files changed, 43 insertions(+), 8 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list